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

Conversation

Varun-Choudhary
Copy link
Contributor

Description 📝

Added a caution note in the comparison operators documentation to clarify the correct syntax when using the _in operator with multiple values. This helps prevent a common mistake where users might use comma-separated strings instead of proper array syntax.

The note includes:

  • Correct array syntax example
  • Incorrect string syntax example
  • Warning about GraphiQL auto-generated queries

Quick Links 🚀

Assertion Tests 🤖

@hasura-bot
Copy link
Contributor

DX: Assertion Testing

✅ Diff

The additional clarification on the correct usage of the _in operator with arrays is helpful for avoiding common mistakes. Explicitly stating the correct and incorrect usages and highlighting the potential issue with auto-generated queries from GraphiQL improves clarity and prevents confusion.

✅ Integrated

The added caution fits well within the context of the section on list-based search operators. It serves as a valuable caveat immediately following relevant examples and contributes positively to the overall usability of the document. This change enables users to more effectively understand and utilize the _in operator in their GraphQL queries.

@hasura-bot hasura-bot requested a review from seanparkross April 7, 2025 04:25
@hasura-bot
Copy link
Contributor

@Varun-Choudhary Thanks for your PR! I've assigned @seanparkross to review it.

Copy link

Deploying ddn-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 635eb2f
Status: ✅  Deploy successful!
Preview URL: https://7c3813a3.v3-docs-eny.pages.dev
Branch Preview URL: https://varun-add-note.v3-docs-eny.pages.dev

View logs

@codedmart
Copy link
Contributor

Are there more array operators we should make this comment more generic for?

@robertjdominguez robertjdominguez requested review from robertjdominguez and removed request for seanparkross April 7, 2025 14:07
@robertjdominguez robertjdominguez merged commit 3eb44c9 into main Apr 7, 2025
5 checks passed
@robertjdominguez robertjdominguez deleted the varun/add-note branch April 7, 2025 14:08
@Varun-Choudhary
Copy link
Contributor Author

Varun-Choudhary commented Apr 7, 2025

Are there more array operators we should make this comment more generic for?

I don't think so. There are array operators like contain, _nin etc but our graphiql engine don't have these.
https://hasura.io/docs/3.0/graphql-api/queries/filters/comparison-operators

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants