😎 Discover cool tips and tricks for customization in our next Developer Deep Dive virtual event - sign up now!

CannotQuery Field [Field] on type [Type]

3 replies
Last updated: Dec 6, 2021
Consistently getting a "Cannot query field [field] on type [Type]." when I add new fields to an object. Can't see anything which changed before this that could cause it. Any ideas?
Nov 22, 2021, 5:12 PM
Did you change the name of the sanity dataset? I had the same error but on dev it worked as it pulled the correct one, but build was still using the the “old” dataset.
Dec 6, 2021, 10:47 AM
Also I sometimes forget to CTRL+C when changing the graphql.
As for the fields you also need to “sanity graphql deploy” each time you add new objects or documents to the schema.
Dec 6, 2021, 10:49 AM
Noooo of course this is it! So yes, I was changing between multiple datasets and not deploying the dataset I was consuming! Such a dumb mistake, but thanks for bringing up datasets.
Dec 6, 2021, 5:24 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?