When extending a type, the plugin can at times fail to determine the original type extended the Node interface. This is likely a race condition, where the node we're extending is being created by buildObjectType before it's declared to be implementing the Node interface.
This means that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be of type Node.
"When defining top-level types, don't forget to pass interfaces: ['Node'], which does the same for Type Builders as adding implements Node to SDL-defined types."
Steps to Test
Related issue: #136
Code:
warn Type ImagesJson declared in createTypes looks like a node, but doesn't implement a Node interface. It's likely that you should add the Node interface to your type def:
type ImagesJson implements Node { ... }
If you know that you don't want it to be a node (which would mean no root queries to retrieve it), you can explicitly disable inference for it:
type ImagesJson @dontInfer { ... }
ERROR
Building schema failed
not finished building schema - 0.106s
This commit addresses issue #136.
When extending a type, the plugin can at times fail to determine the original type extended the
Node
interface. This is likely a race condition, where the node we're extending is being created bybuildObjectType
before it's declared to be implementing the Node interface.This means that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be of type
Node
.For more information see the Gatsby documentation here: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#gatsby-type-builders
Steps to Test
Related issue: #136
Code:
Steps:
npm run develop
node_modules/@imgix/gatsby/src/modules/gatsby-plugin/gatsby-node.ts
161
addinterfaces: ["Node"],