Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-source-contentful): Add contentful_id field recursively #20258

Merged
merged 1 commit into from
Dec 22, 2019
Merged

fix(gatsby-source-contentful): Add contentful_id field recursively #20258

merged 1 commit into from
Dec 22, 2019

Conversation

TuckerWhitehouse
Copy link
Contributor

Description

The gatsby-source-contentful fixIds method is recursively "fixing" contentful node ids, but only adding a contentful_id field one level deep.

Documentation

Related Issues

Fixes #15426

@TuckerWhitehouse TuckerWhitehouse requested a review from a team as a code owner December 21, 2019 18:15
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Thanks!

@sidharthachatterjee sidharthachatterjee changed the title Add contentful_id field recursively in gatsby-source-contentful fix(gatsby-source-contentful): Add contentful_id field recursively Dec 22, 2019
@sidharthachatterjee sidharthachatterjee merged commit deb41cd into gatsbyjs:master Dec 22, 2019
@TuckerWhitehouse TuckerWhitehouse deleted the topics/contentful-normalize-fix-ids branch December 22, 2019 17:24
@vladar
Copy link
Contributor

vladar commented Dec 23, 2019

Published in [email protected]

}
if (_.isPlainObject(val)) {
return fixIds(val)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should account for circular references otherwise we'll get stack overflow errors. Probably also need a test with circular references.

@alex-p-chan
Copy link
Contributor

This fix broke my code. We use some circular references. Perhaps it should be an option instead of the default?

"gatsby-source-contentful" threw an error while running the sourceNodes lifecycle:
Maximum call stack size exceeded

@bsgreenb
Copy link

Correct, I've been able to repro that upgrading to this version causes Maxmimum Callstack issue.

@pvdz
Copy link
Contributor

pvdz commented Jan 6, 2020

--> #20313

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gatsby-source-contentful not adding contentful_id to all nodes
6 participants