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

Support introspection of deprecated input values #172

Closed
CodingContraption opened this issue Jan 28, 2025 · 2 comments
Closed

Support introspection of deprecated input values #172

CodingContraption opened this issue Jan 28, 2025 · 2 comments

Comments

@CodingContraption
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When making introspection requests trough graphql-protect, and including for example the isDeprecated field on __InputValue, or the includeDeprecated argument on an args field, graphql-protect will throw an error. This is an example of an introspection response of graphql-protect in front of an apollo router API:

{
  "data": null,
  "errors": [
    {
      "message": "Cannot query field \"isDeprecated\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 64,
          "column": 3
        }
      ]
    },
    {
      "message": "Cannot query field \"deprecationReason\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 65,
          "column": 3
        }
      ]
    },
    {
      "message": "Unknown argument \"includeDeprecated\" on field \"__Field.args\".",
      "locations": [
        {
          "line": 32,
          "column": 5
        }
      ]
    },
    {
      "message": "Unknown argument \"includeDeprecated\" on field \"__Type.inputFields\".",
      "locations": [
        {
          "line": 41,
          "column": 3
        }
      ]
    },
    {
      "message": "Unknown argument \"includeDeprecated\" on field \"__Directive.args\".",
      "locations": [
        {
          "line": 19,
          "column": 7
        }
      ]
    },
    {
      "message": "Cannot query field \"isDeprecated\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 64,
          "column": 3
        }
      ]
    },
    {
      "message": "Cannot query field \"deprecationReason\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 65,
          "column": 3
        }
      ]
    },
    {
      "message": "Unknown argument \"includeDeprecated\" on field \"__Field.args\".",
      "locations": [
        {
          "line": 32,
          "column": 5
        }
      ]
    },
    {
      "message": "Unknown argument \"includeDeprecated\" on field \"__Type.inputFields\".",
      "locations": [
        {
          "line": 41,
          "column": 3
        }
      ]
    },
    {
      "message": "Cannot query field \"isDeprecated\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 64,
          "column": 3
        }
      ]
    },
    {
      "message": "Cannot query field \"deprecationReason\" on type \"__InputValue\".",
      "locations": [
        {
          "line": 65,
          "column": 3
        }
      ]
    }
  ]
}

Describe the solution you'd like
I deduced that this was caused due to missing support in the gqlparser library for these fields, as it was missing recent graphql spec compatibility. In a recent PR this has been fixed, and since 2.5.22 support for introspection of deprecated input values should be present.

So a simple update of the dependency should fix this. I would also like to see a note in the readme to educate users about the graphql spec compatibility.

Describe alternatives you've considered

Additional context

@ldebruijn
Copy link
Owner

@CodingContraption can this issue be closed now that #173 is merged?

@CodingContraption
Copy link
Contributor Author

Yes it can, can confirm the newly released version fixed this problem!

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

No branches or pull requests

2 participants