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?
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.
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.
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.
Sanity.io is a platform to build websites and applications. It comes with great APIs that let you treat content like data. Free to get started, and pay-as-you-go on all plans. Find out more.