Cannot destructure property `wpgraphql` of 'undefined' or 'null'
See original GitHub issueDescription
Always getting an error “Cannot destructure property wpgraphql
of ‘undefined’ or ‘null’”
See Screesnhot: https://imgur.com/hQCGxaR
Steps to reproduce
Im using wpgraphql ACF CPT UI. At first I registered a Custom Post type for “Event” then everything works. fetching wpgraphql schema and creating pages works like a charm. Then suddenly when I registered a new one “Courses” custom post type, this error happens. I trouble shoot it assuming I have a typo until I notice that my code is not the problem because even I try to comment some code to see the changes then error still the same. So what I did is I ask for help from the wpgraphql slack group and mentioned JSON bahl, so he told me try to Gatsby clean, but it won’t fix the issue. So he mentioned TylerB hoping for help and it seems Tyler recommend to open an issue at Gatsby Repo.
See screenshot: https://imgur.com/J2tQAUW
Actual result
See Screesnhot: https://imgur.com/hQCGxaR
Environment
Run gatsby develop
My Project Repo
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Your GraphQL schema has no
events
field on RootQuery type. And you are querying it here.So either your query is wrong (maybe you must change it to
eventFields
?) or something is wrong with server-side schema.Thank you so much guys 😃 Fixed it 😄