Skip to content

Add note about correct _in operator array syntax #983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/graphql-api/queries/filters/comparison-operators.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,20 @@ Fetch a list of articles rated 1, 3 or 5:
}`}
/>

:::caution Using _in operator with multiple values
When using the `_in` operator with multiple values in GraphiQL or your application code, always use proper array syntax with square brackets:
```
where: { rating: { _in: [1, 3, 5] } } // CORRECT
```

Do not use comma-separated strings, as this will not work correctly:
```
where: { rating: { _in: "1, 3, 5" } } // INCORRECT
```

While GraphiQL may sometimes auto-generate queries using the incorrect string format, these queries will not function properly when executed against the GraphQL server.
:::

## Filter or check for null values (\_is_null)

Checking for null values can be achieved using the `_is_null` operator.
Expand Down
Loading