Skip to content

Parent/child link created from remote file node not persisted in cache #33831

Answered by LekoArts
Mrtenz asked this question in Help
Discussion options

You must be logged in to vote

Hi!

You're running into two things:

  1. createParentChildLink is intended for another use case. It's purpose is to create derived nodes from a parent and not referencing related nodes. It's used in transformers primarily: https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/creating-a-transformer-plugin/#creating-the-transformer-relationship
  2. Since you're working in onCreateNode the direct mutation of the node won't no longer work with v4: https://www.gatsbyjs.com/docs/reference/release-notes/migrating-from-v3-to-v4/#dont-mutate-nodes-outside-of-expected-apis - so you're running into that change

You can fix it like this:

// gatsby-node.js
const { createRemoteFileNode } = require('gatsby-s…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@Mrtenz
Comment options

@LekoArts
Comment options

@Mrtenz
Comment options

Answer selected by LekoArts
Comment options

You must be logged in to vote
1 reply
@Ruben-deBruijn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #33821 on November 03, 2021 07:58.