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.

gatsby-source-wordpress: GraphQL process stops on this query

See original GitHub issue

My builds sometimes work and sometimes fail with no changes to my code but I think this is related or the cause.

I’ve rewritten this query to be somewhat generic. The area to focus in on is the wpParent part. Any query I have with that kills the GraphQL process immediately. The returned error code is below as well.

query ParentPageQuery {
  allWpCustomPostType(limit: 4, filter: {wpParent: {node: {slug: {eq: "parent-slug-name"}}}}) {
    nodes {
      title
    }
  }
}
ERROR 
Cannot read property 'typeInfo' of undefined
TypeError: Cannot read property 'typeInfo' of   undefined

The only way I see around this is to avoid using any wpParent mentions in my queries. I checked the other issues and this isn’t mentioned yet so it may be a new one.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
emaildanocommented, Sep 29, 2020

Hey @TylerBarnes, I don’t have an env to share just yet but I will get you one soon. This hasn’t fallen off my radar, I’m still working through this. Some good news, I think I was able to narrow down the issue.

This query works great:

{
  allWpCustomPostType(limit: 4, filter: {parentDatabaseId: {eq: 123}}) {
    nodes {
      ... on WpCustomPostType {
        title
      }
    }
  }
}

This, throw an error:

{
  allWpCustomPostType(limit: 4, filter: {wpParent: {node: {slug: {eq: "post-slug"}}}}) {
    nodes {
      ... on WpCustomPostType {
        title
      }
    }
  }
}

Using the slug or the post ID result in the same error.

I think it’s related to the wpParent filter. Once I start to use filters for that option stuff starts to break. Not 100% of the time though which is what make this so hard to trace. What seems to work is going to the backend of WP and re-publishing the page. I don’t know if that affects cache but it seems to work sometimes after that.

This only happens during development and to my knowledge has not affected any builds.

For now, I’ll avoid that wpParent filter if only for testing.

0reactions
github-actions[bot]commented, Jul 18, 2021

Hey again!

It’s been 60 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Please keep in mind that I’m only a robot, so if I’ve closed this issue in error, I’m HUMAN_EMOTION_SORRY. Please feel free to comment on this issue or create a new one if you need anything else. As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 💪💜

Read more comments on GitHub >

github_iconTop Results From Across the Web

WORDPRESS-GATSBY DEPLOY FAILS - Stack Overflow
So i changed the query field to graphql but that didnt work either to i resorted to installing the gatsby-source-wordpress plugin hoping it ......
Read more >
Troubleshooting Common Errors - Gatsby
comes up when a GraphQL query is trying to query a field for subfields, but none exist. This generally happens when plugins that...
Read more >
Using New Gatsby Source WordPress Plugin - CSS-Tricks
js { resolve: gatsby-source-wordpress, options: { // WordPress is the GraphQL url. url: process.env.WPGRAPHQL_URL || https://wpgatsbydemo ...
Read more >
Gatsby Changelog | 5.3.0
Gatsby uses child processes to execute its GraphQL queries in parallel (with its own package gatsby-worker ). When Parallel Query Running was introduced ......
Read more >
gatsby-source-graphql - npm
By default, gatsby-source-graphql will only refetch the data once the server is restarted. It's also possible to configure the plugin to ...
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