> ## Documentation Index
> Fetch the complete documentation index at: https://helix-digitalocean.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# E621

# Invalid Boolean Comparison

## Erroneous Code Example

This error occurs when you try to apply a boolean comparison operation to a type that doesn't support it.

In this example, the `&&` operator is used on a non-boolean type.

<CodeGroup>
  ```rust queries.hx theme={null}
  Query getUser(user1: ID, user2: ID) =>
      user1 <- N<User>(user1)
      user2 <- N<User>(user2)
      is_eq <- user1::EQ(user2)
      RETURN is_eq
  ```

  ```rust schema.hx theme={null}
  N::User {
      name: String,
  }
  ```
</CodeGroup>

## Solution

Ensure boolean operations are used on values that result in primitive types like booleans, numbers, or strings.

<CodeGroup>
  ```rust queries.hx theme={null}
  Query getUser(user1: ID, user2: ID) =>
      user1_name <- N<User>(user1)::{name}
      user2_name <- N<User>(user2)::{name}
      is_eq <- user1_name::EQ(user2_name)
      RETURN is_eq
  ```
</CodeGroup>
