-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building schema failed: Type <type name>
declared in createTypes
looks like a node, but doesn't implement a Node
interface
#136
Comments
Hi @arsinclair 👋 thanks for opening this issue. Sorry that you've had this experience - I've put this on my schedule to investigate next week. I'll provide any updates here. |
Pardon? 🙁 |
Sorry @arsinclair, I was responding to another issue at the same time and I must have got my wires crossed here! |
Hey @arsinclair, Having trouble reproducing the issue. Do you think you could create and link an example repo that reproduces it? Thanks again for taking the time to report this. |
Sure. Here's the repo: https://github.com/arsinclair/gatsby-image-schema-bug-reproduction Just run P.S.: I used a test image from imgix, because I can not use put my organization's endpoint. I don't know if Imgix uses Amazon.S3 as the backend for their assets.imgix.net, but it is clear that the issue is reproduced with any image. |
If you comment out the @imgix/gatsby config in gatsby-config.js file and use GraphiQL, you'll see that the actual image URL is parsed okay and the type name matches: {
imagesJson {
__typename
url
}
} output: {
"data": {
"imagesJson": {
"__typename": "ImagesJson",
"url": "https://assets.imgix.net/examples/bluehat.jpg"
}
},
"extensions": {}
} |
This commit addresses issue #136. When extending nodes that were defined with Node inference, the plugin can at times fail to detect the Node interface. For example, if the original node being extented was defined using SDL, extending it without adding `interfaces: Node` will mean that GraphQl doesn't know that the node being created extends the Node type. This mean that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be a Node type but was not. For more information see the Gatsby documentation here: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#gatsby-type-builders It says, "When defnining 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."
This commit addresses issue #136. When extending nodes that were defined with Node inference, the plugin can at times fail to detect the Node interface. For example, if the original node being extented was defined using SDL, extending it without adding `interfaces: Node` will mean that GraphQl doesn't know that the node being created extends the Node type. This mean that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be a Node type but was not. For more information see the Gatsby documentation here: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#gatsby-type-builders It says, "When defnining 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."
### [1.6.12-rc.1](v1.6.11...v1.6.12-rc.1) (2021-08-05) ### Bug Fixes * **pe1168:** looks like node but missing interface ([bbee4e4](bbee4e4)), closes [#136](#136) [skip ci]
Hey @arsinclair, Thanks again for sending over the example repo, it was extremely helpful! This issue should be fixed in version If for any reason this isn't resolved please free to comment on this issue so we can open it up again. |
Hey @luqven, can you confirm this is fixed with |
This commit addresses issue #136. When extending nodes that were defined with Node inference, the plugin can at times fail to detect the Node interface. For example, if the original node being extented was defined using SDL, extending it without adding `interfaces: Node` will mean that GraphQl doesn't know that the node being created extends the Node type. This mean that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be a Node type but was not. For more information see the Gatsby documentation here: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#gatsby-type-builders It says, "When defnining 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."
This commit addresses issue #136. When extending nodes that were defined with Node inference, the plugin can at times fail to detect the Node interface. For example, if the original node being extented was defined using SDL, extending it without adding `interfaces: Node` will mean that GraphQl doesn't know that the node being created extends the Node type. This mean that our plugin could cause errors to be thrown at build time, as the newly created type was expected to be a Node type but was not. For more information see the Gatsby documentation here: https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#gatsby-type-builders It says, "When defnining 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."
### [1.7.3](v1.7.2...v1.7.3) (2021-12-08) ### Bug Fixes * **pe1168:** looks like node but missing interface ([9c25082](9c25082)), closes [#136](#136) [skip ci]
Hey @lezan, thanks again for letting us know this was still an issue. The issue should be fixed in version 1.7.3. You can install it by running If for any reason this isn't resolved please free to comment on this issue so we can open it up again. |
Description
With
@imgix/gatsby
enabled,gatsby develop
andgatsby build
result in the following error:To Reproduce
I have the following tandem configured:
gatsby-source-filesystem
to read a json file calledimages.json
with data, like this:then
gatsby-transformer-json
to parse the JSON file, and finally@imgix/gatsby
with the following configuration:If I disable
@imgix/gatsby
in the config - build succeeds. The JSON is parsed just fine, verified in GraphiQL.It appears to be clear that the issue is isolated to imgix/gatsby.
Expected behaviour
No error, and an
images
node with stuff added to myImagesJson
object. The configuration above used to work withgatsby-plugin-imgix
and Gatsby v2 before.Information:
Additional context
I'm happy to provide any additional information, if required.
The text was updated successfully, but these errors were encountered: