Skip to content

Commit a3ad6d7

Browse files
authored
fix(gatsbu-source-contentful): apply useNameForId when creating the graphql schema (#28649)
1 parent a03e862 commit a3ad6d7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

packages/gatsby-source-contentful/src/gatsby-node.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,15 @@ exports.sourceNodes = async (
346346

347347
const gqlTypes = contentTypeItems.map(contentTypeItem =>
348348
schema.buildObjectType({
349-
name: _.upperFirst(_.camelCase(`Contentful ${contentTypeItem.name}`)),
349+
name: _.upperFirst(
350+
_.camelCase(
351+
`Contentful ${
352+
pluginConfig.get(`useNameForId`)
353+
? contentTypeItem.name
354+
: contentTypeItem.sys.id
355+
}`
356+
)
357+
),
350358
fields: {
351359
contentful_id: { type: `String!` },
352360
id: { type: `ID!` },

0 commit comments

Comments
 (0)