Skip to content

Commit

Permalink
fix(gatsby): Improve warning for built-in GraphQL type overrides (#21899
Browse files Browse the repository at this point in the history
)

* fix(gatsby): improve warning for built-in types overrides

* Fixed linting error
  • Loading branch information
vladar committed Mar 2, 2020
1 parent 097b235 commit 1f4db4b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/gatsby/src/schema/schema.js
Expand Up @@ -373,13 +373,19 @@ const mergeTypes = ({
addExtensions({ schemaComposer, typeComposer, plugin, createdFrom })

return true
} else {
} else if (typeOwner) {
report.warn(
`Plugin \`${plugin.name}\` tried to define the GraphQL type ` +
`\`${typeComposer.getTypeName()}\`, which has already been defined ` +
`by the plugin \`${typeOwner}\`.`
)
return false
} else {
report.warn(
`Plugin \`${plugin.name}\` tried to define built-in Gatsby GraphQL type ` +
`\`${typeComposer.getTypeName()}\``
)
return false
}
}

Expand Down

0 comments on commit 1f4db4b

Please sign in to comment.