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

Cannot validate against deprecated arguments in server introspection #2839

Open
4 tasks
casey-chow opened this issue Jan 9, 2025 · 0 comments
Open
4 tasks

Comments

@casey-chow
Copy link

casey-chow commented Jan 9, 2025

Issue workflow progress

Progress of the issue based on the
Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run pnpm generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

Describe the bug

I have a number of queries using deprecated arguments in my server, but I noticed that when I try to validate the queries against the server using introspection, Inspector does not recognize those arguments.

To Reproduce Steps to reproduce the behavior:

  1. Create a schema with an deprecated argument.
    type Query {
        testField(arg: Boolean @deprecated(reason: "I felt like it.")): Boolean
    }
  2. Create an operation that uses the deprecated argument:
    query TestQuery {
      testField(arg: true)
    }
  3. Run a server: graphql-inspector serve schema.gql
  4. Run graphql-inspector validate query.gql http://localhost:4000/graphql

Expected behavior

The schema should validate.

Environment:

  • OS: macOS Sonoma
  • @graphql-inspector/cli: 5.0.8
  • graphql: 16.8.0
  • NodeJS: 20.18.0

Additional context

I believe I've traced it down to a change in graphql-js 15.4.0: graphql/graphql-js#2834

They allow adjusting the introspection query to include deprecated arguments, but GraphQL Inspector does not allow modifying the introspection query or inputting options into the generation function.

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

1 participant