Replies: 4 comments
-
Thank you for the detailed report. I'll have a look. @wardpeet Seems like your changed introduced the issue, any idea why? |
Beta Was this translation helpful? Give feedback.
-
My guess is that this was luck that it worked before. The order how we create nodes probably got changed. It's not a good idea to fetch other nodes during onCreateNode call. @osartun I suggest creating a customer resolver instead of adding it as a field to the object. |
Beta Was this translation helpful? Give feedback.
-
@wardpeet You mean the |
Beta Was this translation helpful? Give feedback.
-
@osartun https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/ this comes closest to what you're looking for |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Preliminary Checks
Description
We have a local transformer plugin built on top of
gatsby-source-contentful
which breaks when we update the Contentful plugin. The problem is thatgetNode(…)
returnsnull
for certain referenced nodes even though the nodes exist at the end of the bootstrap process.The issue didn't exist until
2.1.100
. It must have been introduced with #22307 when sourcing nodes was turned asynchronous.Related links:
getNode
returns null on upgrade from gatsby-source-contentful 2.1.88 to 2.2.5 #22792 (comment)Reproduction Link
https://github.com/osartun/gatsby-contentful-transformer-issue
Steps to Reproduce
Clone the reproduction repo and run gatsby in the
v3
folder. Read more in the README of the reproduction repo.Alternatively:
gatsby-source-contentful >= 2.2.0
gatsby-node.js
in theonCreateNode
lifecycle callgetNode()
with the ID of the referenced nodeExpected Result
getNode({referenced id})
returns the nodeActual Result
getNode({referenced id})
returns nullEnvironment
Config Flags
No response
Beta Was this translation helpful? Give feedback.
All reactions