I have used the https://github.com/vladar/gatsby-graphql-toolkit-examples/tree/master/craft-cms example and seem to run into an issue...
in the craft-cms graphiql editor, the following graphql query:
query {
globalSet {
id
}
}
returns this data:
{
"data": {
"globalSet": {
"id": "70"
}
}
}
But in gatsby, using the gatsby-graphql-toolkit to create the data layer, the same query
const query = useStaticQuery(graphql`
query {
globalSet {
id
}
}
`);
results in the following error:
There was an error in your GraphQL query:
Cannot query field "globalSet" on type "Query".
If you don't expect "globalSet" to exist on the type "Query" it is most likely a
typo. However, if you expect "globalSet" to exist there are a couple of
solutions to common problems:
- If you added a new data source and/or changed something inside
gatsby-node/gatsby-config, please try a restart of your development server.
- You want to optionally use your field "globalSet" and right now it is not used
anywhere.
It is recommended to explicitly type your GraphQL schema if you want to use
optional fields.
File: src/components/molecules/autocomplete/autocomplete.jsx:157:9
See our docs page for more info on this error:
https://gatsby.dev/creating-type-definitions
I have gone through the Troubleshooting instructions and believe that there is an issue with the schema customization logic, which is why I'm filing this issue.
I hope there is someone who can assist! Been trying to resolve this for a couple of weeks.
Using:
Gatsby 5.8.0
Gatsby Graphql Source Toolkit 2.0.4
I have used the https://github.com/vladar/gatsby-graphql-toolkit-examples/tree/master/craft-cms example and seem to run into an issue...
in the craft-cms graphiql editor, the following graphql query:
returns this data:
But in gatsby, using the
gatsby-graphql-toolkitto create the data layer, the same queryresults in the following error:
I have gone through the Troubleshooting instructions and believe that there is an issue with the schema customization logic, which is why I'm filing this issue.
I hope there is someone who can assist! Been trying to resolve this for a couple of weeks.
Using:
Gatsby
5.8.0Gatsby Graphql Source Toolkit
2.0.4