Skip to content

Commit 1f4db4b

Browse files
authoredMar 2, 2020
fix(gatsby): Improve warning for built-in GraphQL type overrides (#21899)
* fix(gatsby): improve warning for built-in types overrides * Fixed linting error
1 parent 097b235 commit 1f4db4b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎packages/gatsby/src/schema/schema.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -373,13 +373,19 @@ const mergeTypes = ({
373373
addExtensions({ schemaComposer, typeComposer, plugin, createdFrom })
374374

375375
return true
376-
} else {
376+
} else if (typeOwner) {
377377
report.warn(
378378
`Plugin \`${plugin.name}\` tried to define the GraphQL type ` +
379379
`\`${typeComposer.getTypeName()}\`, which has already been defined ` +
380380
`by the plugin \`${typeOwner}\`.`
381381
)
382382
return false
383+
} else {
384+
report.warn(
385+
`Plugin \`${plugin.name}\` tried to define built-in Gatsby GraphQL type ` +
386+
`\`${typeComposer.getTypeName()}\``
387+
)
388+
return false
383389
}
384390
}
385391

0 commit comments

Comments
 (0)
Please sign in to comment.