-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
generate
throw Cannot query field 'isOneOf'
#316
Comments
That would mean that when we run the Would you mind running the support query on your endpoint and seeing what it comes up with? Mind also check the definition of I wonder whether this is related to graphql/graphql-js#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 |
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 like
gql.tada
is trying to query a field that doesn't exist in our schema.Our GraphQL API endpoint
https://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
The text was updated successfully, but these errors were encountered: