How to Express 'OR' in a GraphQL Query

1 replies
Last updated: Aug 7, 2020
Hi everyone! 👋 🙂 Is there a way to express ‘OR’ in a GraphQL query? Can’t see an option for that in the docs: https://www.sanity.io/docs/graphql#filters-reference-ba117ddb05ce
Aug 7, 2020, 8:08 AM
Aha, I hacked something workable by using a couple of GraphQL aliases with slightly different filters, and then merging it in code. https://graphql.org/learn/queries/#aliases
Aug 7, 2020, 8:49 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?