question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot destructure property `wpgraphql` of 'undefined' or 'null'

See original GitHub issue

Description

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

https://github.com/rayjencode/gatsby-wp-university

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vladarcommented, Mar 24, 2020

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.

0reactions
rayjencodecommented, Mar 24, 2020

Thank you so much guys 😃 Fixed it 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby-Source-Wordpress: Error when compiling. TypeError
Gatsby-Source-Wordpress: Error when compiling. TypeError: Cannot destructure property 'fields' of 'nodesType' as it is undefined.
Read more >
TypeError: Cannot destructure property `text` of 'undefined' or ...
This may be due to the following: cards is null; id or side did not contain the expected value so the value of...
Read more >
Discussion of Blog with Pagination - Guide to Gatsby WordPress ...
TypeError : Cannot destructure property wpgraphql of 'undefined' or 'null'. I traced it back to the PostTemplateFragment and BlogPreviewFragment within the ...
Read more >
Cannot Destructure Property 'Idevento' Of 'This.Store.Selectsnapshot
Cannot destructure property error of undefined or null is because of the n emphasis mine: The property is assigned a default value after...
Read more >
Cannot destructure property 'prisma__type' of 'object null' as ...
When we try to execute the prisma raw query this error is coming in aws lambda dev server. But in local docker seems...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found