🔮 Sanity Create is here. Writing is reinvented. Try now, no developer setup

Troubleshooting warning for documents not declared in GraphQL schema during Gatsby build

9 replies
Last updated: Apr 28, 2020
I see the following warning for 3 documents during `gatsby build`:
[sanity] Document "fbca6239-40f3-4c6b-b197-224106c7fb38" has type position (SanityPosition), which is not declared in the GraphQL schema. Make sure you run "graphql deploy". Skipping document.
How do I find that document within Sanity?
Apr 28, 2020, 1:40 PM
Hi Chandler, if
position
is a document type you have recently created but not yet deployed, try running
sanity graphql deploy
. If it’s a leftover from the past, I guess you could either delete these documents via the CLI (
sanity documents delete <doc-id>
) or create a new
position
document type just so you can review the past items and then remove as necessary.
Apr 28, 2020, 1:59 PM
ah, thanks. I think deleting them works fine.
Apr 28, 2020, 1:59 PM
I’ve run the
graphql deploy
several times so I think the delete command is what I need.
Apr 28, 2020, 2:00 PM
If you don’t have a document type called
position
in your schema at the moment, the deploy command will not resolve the issue in this case, which is what might be going on. These seem to be former documents added when there was still a
position
doc type.
Apr 28, 2020, 2:01 PM
That makes sense
Apr 28, 2020, 2:02 PM
I think these were leftovers from our initial setup or from following a tutorial of some sort.
Apr 28, 2020, 2:02 PM
(You can still view them if you re-create that type, in case there’s information in there you might need.)
Apr 28, 2020, 2:02 PM
¯\_(ツ)_/¯ already deleted them
Apr 28, 2020, 2:02 PM
🤠
Apr 28, 2020, 2:02 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?