[gatsby-source-contentful] Why do content types use name instead of ID? #34400
Unanswered
njbmartin
asked this question in
Ideas / Feature Requests
Replies: 1 comment 1 reply
-
Correction, it breaks queries regardless if you use fragments ;) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
@axe312ger I've just stumbled on an issue when renaming the "display name" for a content type, which results in queries suddenly failing because the type this plugin creates uses the name field (eg.
Content Highlight Section
), and not the ID (eg.contentHighlightSection
).I have prefixed some content types with
[deprecated]
to show content editors which types not to use any more without their content suddenly disappearing... unfortunately that's exactly what has happened here. If I wasn't pinning the schema withgatsby-plugin-schema-snapshot
, this may not have surfaced as an issue, but I definitely believe the type name should be inferred from the ID.The name field can be changed at any time, whereas the ID field cannot, so I think the below doesn't make sense, at least for the type definition.
gatsby/packages/gatsby-source-contentful/src/create-schema-customization.js
Lines 117 to 138 in 6ffe0af
I can't use the config option
useNameForId: false
, as that changes the content nodes, so all the queries then break. Also,useNameForId
when it's aname
field?Beta Was this translation helpful? Give feedback.
All reactions