✨Discover storytelling in the AI age with Pixar's Matthew Luhn at Sanity Connect, May 8th—register now

How to Remove GraphQL Fields Based on Other Fields in Gatsby

2 replies
Last updated: Aug 9, 2021
How do you remove a GraphQL field based on another field, on a Gatsby page query?

https://stackoverflow.com/questions/68714301/how-to-remove-graphql-fields-according-to-other-fields-in-gatsby
Aug 9, 2021, 3:39 PM
Aug 9, 2021, 3:47 PM
Thanks for your reply! Query Filters seem to only allow to filter fields based on the values of those same fields. I want to remove the URL field based on the sibling “public” field. If the video is not public, remove the URL. Otherwise, include it.
Aug 9, 2021, 5:44 PM

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?