Troubleshooting warning for documents not declared in GraphQL schema during Gatsby build
You can find that document in Sanity Studio by navigating directly to it using the document ID in the URL. Here are a few ways to locate it:
Method 1: Direct URL (fastest)
Add the document ID to your Studio URL like this:
https://your-studio.sanity.studio/desk/fbca6239-40f3-4c6b-b197-224106c7fb38
Replace your-studio.sanity.studio with your actual Studio URL. This will open the document directly if it exists.
Method 2: Vision Plugin (if installed)
If you have the Vision plugin installed in your Studio, you can run a GROQ query to find the document:
*[_id == "fbca6239-40f3-4c6b-b197-224106c7fb38"]This will return the document and show you all its fields, including the _type.
Method 3: API Query
You can also query for it using the Sanity CLI or HTTP API:
sanity documents get fbca6239-40f3-4c6b-b197-224106c7fb38About the warning itself:
The warning indicates that you have a document of type position (with schema name SanityPosition) that exists in your dataset, but it's not included in your GraphQL schema deployment. To fix this, you need to:
- Make sure the
positionschema type is defined in your Studio's schema files - Run
sanity graphql deployto update your GraphQL API with the current schema
If you've removed this document type from your schema but the documents still exist, you may want to delete them or migrate them to a different type. The direct URL method above will let you view and delete the document if needed.
Sanity – Build the way you think, not the way your CMS thinks
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.