Open ruiaraujo opened 5 years ago
Hey, thanks for using this project and reporting a bug. Would you happen to have a simple test case that I can debug?
Try this file
type Query {
version: String!
name: String!
}
extend type Query {
hello: String!
}
Thanks for that simple sample. Walking through the code, I actually think this is a bug with graphql creating an ast. I can see where it adds the type (and checks for any directives) but I don't see where it's handling extensions. I'm going to find some time to create a test outside of this project to see if it is a bug of theirs and that way I can submit a bug report.
I will go ahead and see what you would expect here for this project. Would you like to just see the hello
field with the other two fields in the type code block or something special to show it was added in via extension?
Yes, looks like this is an upstream bug in graphql-js
. There is this issue that discusses extension and the ast being built not including it but looks like they want to throw an error in that simple case.
However, I don't see why a type extension like your simple example shouldn't just work so I opened this: graphql/graphql-js#1701
So good news, they are refactoring some things and one of the things they are doing is handling the extension stuff properly and plan on having that done for their next major release which is good! I'll keep this open so I'll circle around when they get their issue fixed.
We are using the
-s
option with a SDL language file.This file is a concat of multiple separate files which use the
extend Type
syntax to extend the Query type.Unfortunately, these do not show up in the docs.