Skip to content

Cannot validate against deprecated arguments in server introspection #2839

@casey-chow

Description

@casey-chow

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions