You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to migrate a Gatsby project from V2 to V3, and while I seem to have gotten most the dependency issues sorted out I am getting stumped on a graphQL issue when trying to build the site. npm run develop throws the following error:
ERROR #85923 GRAPHQL
There was an error in your GraphQL query:
Cannot query field "content" on type "ContentfulWhatsNewBody".
If you don't expect "content" to exist on the type "ContentfulWhatsNewBody" it is most likely a typo.
However, if you expect "content" 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.js/gatsby-config.js, please try a restart of your
development server
- The field might be accessible in another subfield, please try your query in GraphiQL and use the GraphiQL explorer to see which
fields you can query and what shape they have
- You want to optionally use your field "content" and right now it is not used anywhere. Therefore Gatsby can't infer the type and
add it to the GraphQL schema. A quick fix is to add at least one entry with that field ("dummy content")
It is recommended to explicitly type your GraphQL schema if you want to use optional fields. This way you don't have to add the
mentioned "dummy content". Visit our docs to learn how you can define the schema for "ContentfulWhatsNewBody":
https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization#creating-type-definitions
File: gatsby-node.js:14:12
ERROR
Cannot read property 'guideTopicPages' of undefined
TypeError: Cannot read property 'guideTopicPages' of undefined
- gatsby-node.js:69
/path/to/gatsby-node.js:69:45
The graphQL query in gatsby-node.js looks like this:
graphql(`
query allTypesOfPages {
whatsnew: allContentfulWhatsNew {
edges {
node {
id
body {
content {
content {
value
}
}
}
title
}
}
}
}
`)
This query is completely valid in the version of the project running on GatsbyV2 and there have been no changes to it between the different builds. The only difference is the version of Gatsby, it's associated dependencies, and migrating gatsby-image to gatsby-plugin-image as part of the v3 change. I'm unclear why this query now has issues.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to migrate a Gatsby project from V2 to V3, and while I seem to have gotten most the dependency issues sorted out I am getting stumped on a graphQL issue when trying to build the site.
npm run develop
throws the following error:The graphQL query in
gatsby-node.js
looks like this:This query is completely valid in the version of the project running on GatsbyV2 and there have been no changes to it between the different builds. The only difference is the version of Gatsby, it's associated dependencies, and migrating
gatsby-image
togatsby-plugin-image
as part of the v3 change. I'm unclear why this query now has issues.Beta Was this translation helpful? Give feedback.
All reactions