While I'm not entirely sure what the reasoning is behind it causing errors if it's just not used, I can confirm that it is currently being used.
The thing is that the query fails, even without requesting the fields. I have no mention of my newly added slice in my GraphQL query.
So even with a filled in field and the slice not being requested, I am getting an error and thus as a result null.
For reference, this is the query I'm currently executing. Do note that this query works perfectly in the GraphQL sandbox you guys provide, but it does not in my Next.js project.
{
homepage(uid: "homepage", lang: "en-us") {
body {
... on HomepageBodyGuides_preview {
type
fields {
guide {
... on Polar_guide {
name
intro_text
image
}
}
testje
}
}
}
}
}
When running the query locally, I get these errors
WARNING: heuristic fragment matching going on!
Missing field type in {
"__typename": "HomepageBodyHero"
}
Missing field fields in {
"__typename": "HomepageBodyHero"
}
And this is the result of my query
{ data: null, loading: false, networkStatus: 7, stale: true }
When I remove the slice from the instance of my Homepage (so not from the content type, but the actual content itself), the query works again.
{
data: { homepage: { body: [Array], __typename: 'Homepage' } },
loading: false,
networkStatus: 7,
stale: false
}
Am I doing something wrong?