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

Use createNodeId for gatsby-source-contentful #4016

Closed
KyleAMathews opened this issue Feb 13, 2018 · 5 comments
Closed

Use createNodeId for gatsby-source-contentful #4016

KyleAMathews opened this issue Feb 13, 2018 · 5 comments

Comments

@KyleAMathews
Copy link
Contributor

People think they can query contentful nodes with the Contentful IDs but get tripped up because sometimes they can't due to needing to left-pad ids starting with numbers. Let's just make all IDs UUIDs to prevent that confusion #4001

@mxlje
Copy link

mxlje commented Feb 13, 2018

Maybe i‘m missing something, how would we see those IDs? And how would they be persistent?

Right now I have to run IDs through the fixId function before I can actually use them, but at least it explicitly references the entry by its canonical (contentful) ID in the code.

@pieh
Copy link
Contributor

pieh commented Feb 13, 2018

@mxlje use contentful_id field instead of id field

@mxlje
Copy link

mxlje commented Feb 13, 2018

Ah, of course! Thank you.

@anjawaldbauer
Copy link
Contributor

I might be mistake here, but I think the use of contentful_id is limited to the case where you only have one locale. When you use the contentful_id on a localized node, i.e. where the id ends in __de (for the de localization) you will retrieve the default - e.g. English - node instead of the German (de) node.

@pieh
Copy link
Contributor

pieh commented Jun 19, 2018

This was already done in #3807 and later updated in #5167

@pieh pieh closed this as completed Jun 19, 2018
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

No branches or pull requests

4 participants