Skip to content
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

IntrospectionQuery fails, unable to run graphiql #2085

Closed
moonchariot opened this issue Dec 6, 2021 · 17 comments · Fixed by #2087 or #2097
Closed

IntrospectionQuery fails, unable to run graphiql #2085

moonchariot opened this issue Dec 6, 2021 · 17 comments · Fixed by #2087 or #2097

Comments

@moonchariot
Copy link

Hi everyone,

as of this morning (but possibly even earlier) I haven't been able to run graphiql in my project anymore. After extensive investigation, I've come to a conclusion that none of my changes have broken the app.

It seems to me that the IntrospectionQuery has changed and is not compatible anymore.

Here is the IntrospectionQuery that it's trying to run:

query IntrospectionQuery {
      __schema {
        description
        queryType { name }
        mutationType { name }
        
        types {
          ...FullType
        }
        directives {
          name
          description
          
          locations
          args(includeDeprecated: true) {
            ...InputValue
          }
        }
      }
    }

    fragment FullType on __Type {
      kind
      name
      description
      specifiedByURL
      fields(includeDeprecated: true) {
        name
        description
        args(includeDeprecated: true) {
          ...InputValue
        }
        type {
          ...TypeRef
        }
        isDeprecated
        deprecationReason
      }
      inputFields(includeDeprecated: true) {
        ...InputValue
      }
      interfaces {
        ...TypeRef
      }
      enumValues(includeDeprecated: true) {
        name
        description
        isDeprecated
        deprecationReason
      }
      possibleTypes {
        ...TypeRef
      }
    }

    fragment InputValue on __InputValue {
      name
      description
      type { ...TypeRef }
      defaultValue
      isDeprecated
      deprecationReason
    }

    fragment TypeRef on __Type {
      kind
      name
      ofType {
        kind
        name
        ofType {
          kind
          name
          ofType {
            kind
            name
            ofType {
              kind
              name
              ofType {
                kind
                name
                ofType {
                  kind
                  name
                  ofType {
                    kind
                    name
                  }
                }
              }
            }
          }
        }
      }
    }

and here are the errors that I'm getting:

{
  "errors": [
    {
      "message": "Validation error of type UnknownArgument: Unknown field argument includeDeprecated @ '__schema/directives/args'",
      "locations": [
        {
          "line": 15,
          "column": 16
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    },
    {
      "message": "Validation error of type FieldUndefined: Field 'specifiedByURL' in type '__Type' is undefined @ 'FullType/specifiedByURL'",
      "locations": [
        {
          "line": 26,
          "column": 7
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    },
    {
      "message": "Validation error of type UnknownArgument: Unknown field argument includeDeprecated @ 'FullType/fields/args'",
      "locations": [
        {
          "line": 30,
          "column": 14
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    },
    {
      "message": "Validation error of type UnknownArgument: Unknown field argument includeDeprecated @ 'FullType/inputFields'",
      "locations": [
        {
          "line": 39,
          "column": 19
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    },
    {
      "message": "Validation error of type FieldUndefined: Field 'isDeprecated' in type '__InputValue' is undefined @ 'InputValue/isDeprecated'",
      "locations": [
        {
          "line": 61,
          "column": 7
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    },
    {
      "message": "Validation error of type FieldUndefined: Field 'deprecationReason' in type '__InputValue' is undefined @ 'InputValue/deprecationReason'",
      "locations": [
        {
          "line": 62,
          "column": 7
        }
      ],
      "extensions": {
        "classification": "ValidationError"
      }
    }
  ]
}

I am using:

<dependency>
                <groupId>com.netflix.graphql.dgs</groupId>
                <artifactId>graphql-dgs-platform-dependencies</artifactId>
                <version>4.1.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

And I was able to get the following link from the console:
https://unpkg.com/[email protected]/graphiql.min.js

Let me know if I can provide any more information regarding this issue.

Thank you!

@acao
Copy link
Member

acao commented Dec 6, 2021

What version of graphql-js are you using on the server? My bad, the useDeprecated option might not be compatible with lower than graphql@16. This is something I just added.

your server does not recognize this new introspection option because it isn’t running a version that supports it. I will need to do some kind of feature detection.

@acao
Copy link
Member

acao commented Dec 6, 2021

@saihaj or @IvanGoncharov should we make this opt-in for the user, or is there some way we are able to detect if it’s safe to add this argument to introspection queries?

@moonchariot
Copy link
Author

What version of graphql-js are you using on the server? My bad, the useDeprecated option might not be compatible with lower than graphql@16. This is something I just added.

your server does not recognize this new introspection option because it isn’t running a version that supports it. I will need to do some kind of feature detection.

Thanks for looking into the issue. Unfortunately, I am unable to find the graphql-js version that the project is currently using

@blevine
Copy link

blevine commented Dec 6, 2021

I reverted to https://unpkg.com/[email protected]/* as a work-around until this is fixed.

@nielsutrecht
Copy link

Oh thank god I'm not the only one. I thought I was going crazy.

This is really inconvenient too; I have a demo of our new Netflix DGS service scheduled for tomorrow and just found out GraphiQL broke.

Is there a workaround for this? If I can't get this to work tomorrow morning it's going to be quite embarrassing.

@blevine
Copy link

blevine commented Dec 6, 2021

Is there a workaround for this? If I can't get this to work tomorrow morning it's going to be quite embarrassing.

@nielsutrecht See my reply. #2085 (comment) Revert to the 1.5.8 unpkg.com distribution.

@nielsutrecht
Copy link

@blevine thanks but unfortunately it's a transient dependency. Netflix DGS links to the latest production release. I'll go see if I can figure something out on my end. I'll probably just use a stand-alone tool for the demo :)

@acao acao closed this as completed in #2087 Dec 6, 2021
@blevine
Copy link

blevine commented Dec 6, 2021

@acao It would be great of you could revert this change and publish to unpkg.com until you have a fix.

@acao
Copy link
Member

acao commented Dec 6, 2021

fixed!

@acao acao reopened this Dec 6, 2021
@blevine
Copy link

blevine commented Dec 6, 2021

@acao How long before the fix gets to unpkg.com?

@acao
Copy link
Member

acao commented Dec 6, 2021

I see 1.5.9 is on npm, so that's a question for unpkg!

@acao acao closed this as completed Dec 6, 2021
@acao
Copy link
Member

acao commented Dec 6, 2021

I will check into this after work in a few hours, today is a busy day.

We're hoping to add a test matrix to test against older versions of graphql to prevent this in the future

@blevine
Copy link

blevine commented Dec 6, 2021

@acao 1.5.9 has the breaking change.

@blevine
Copy link

blevine commented Dec 6, 2021

For the record, the fix appears to be in 1.5.11 which was published to npm and is also published to unpkg.com

@acao
Copy link
Member

acao commented Dec 6, 2021

lol yes sorry. npmjs.com was so cached in my browser, it didn't work until i pointed to 1.5.11 specifically 🤣 managing 2 dozen graphql packages, can't always keep track of versions honestly.

need an atlassian changesets automation or custom script to post comments for fix releases. or heck we could just use semantic release. I couldn't get changesets to support pre-releases today without putting every single package in pre-release, which wasn't necessary at all :/

@myronmarston
Copy link

We are getting a slightly different IntrospectionQuery error today:

{
  "errors": [
    {
      "message": "Field 'description' doesn't exist on type '__Schema'",
      "locations": [
        {
          "line": 4,
          "column": 9
        }
      ],
      "path": [
        "query IntrospectionQuery",
        "__schema",
        "description"
      ],
      "extensions": {
        "code": "undefinedField",
        "typeName": "__Schema",
        "fieldName": "description"
      }
    }
  ]
}

I tried pinning to 1.5.11 but it's still broken. I'm going to try downgrading to 1.5.8 and see if that fixes it.

@acao
Copy link
Member

acao commented Dec 7, 2021

@myronmarston your graphql schema needs to support __Schema.description field for the latest release few patch releases.

I'm preparing a fix that makes this an opt-in feature, as I wasn't aware that so many graphql schemas do not support this feature on introspection yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants