Closed Hashs7 closed 3 weeks ago
That would mean that when we run the supportQuery
that the introspection of the introspection tells us we can use that property 😅 When we execute this query we derive whether you support isOneOf
on __Type
. When we see the property is present we'll add it to the introspection like this.
Would you mind running the support query on your endpoint and seeing what it comes up with? Mind also check the definition of __Type
?
I wonder whether this is related to https://github.com/graphql/graphql-js/pull/4078
We could probably make this more obvious in the CLI, but the issue here is that the support query fails with authorization errors (see link)
The problem is pretty common with GraphQL APIs that, over HTTP, require someone to authenticate before sending requests, but that's why we often recommend to use a source SDL file instead.
In this case, the API seems to guard against __type
selections, but does allow __schema
, which is unusual and feels unintentional
I've submitted a fix, since I think we can have better fallback behaviour here
Describe the bug
When I'm running the command
gql.tada generate output
using version above 1.7.0, I encounter an error:Cannot query field 'isOneOf' on type '__Type'
.Behavior
The command should generate the file
graphql-env.d.ts
but it throw the error without creating the file. It seems likegql.tada
is trying to query a field that doesn't exist in our schema. Our GraphQL API endpointhttps://api.oees-kraken.energy/v1/graphql/
doesn't expose theisOneOf
field on the__Type
. This suspected PR might have introduce this bug.There is an possible solution to ensure that the field exists before trying to query it ?
Reproduction
gql.tada version
gql.tada >= v1.7.0
Validations