👀 Our most exciting product launch yet 🚀 Join us May 8th for Sanity Connect

GraphQL query resolving references on a _raw field in Gatsby

2 replies
Last updated: May 17, 2022
Hey all, if within a gatsby project I remove the node_modules and reinstall them I must clear the gatsby cache in order for Mux video to work. I've noticed that when using the GraphiQL interface and I do a graphQL query resolving references on a _raw field if I don't clear the cache the reference then the 'asset' comes back null. As soon as I
gatsby clean
and re-run the same query, the 'asset' field gets populated with all the mux data.
Anyone any idea why this might be happening?
May 17, 2022, 9:15 AM
I’ve also been having this problem, I think it’s a bug in version
7.4.2
as downgrading to
7.4.1
seems to solve it for me. Someone else has opened an issue on Github about this too: https://github.com/sanity-io/gatsby-source-sanity/issues/154
May 17, 2022, 11:20 AM
Thanks Simon. I'll take a look.
May 17, 2022, 8:01 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?