graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

[graphiql] Fragment variables not supported

Open gerdemb opened this issue 3 months ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

  fragment Fragment on AccountsConnection {
    nodes {
      id
      name
      balance(endDate: $date) {
        number
        currency
      }
    }
  }

  # ERROR Variable "$date" is never used in operation "Accounts".GraphQL: Validation
  query Accounts($startsWith: String!, $date: Date = "2024-03-24") {
    accounts(filter: { name: { startsWith: $startsWith } }, orderBy: NAME_ASC) {
      ...Fragment
    }
  }

Has flag this validation error on the Account query: Variable "$date" is never used in operation "Accounts".GraphQL: Validation. Actual code works as expected.

graphql.config.js

const config = {
  schema: "http://ds720.local:3000/graphql",
  documents: ["app/**/*.tsx"],
};

Using VSIX release found here: https://github.com/graphql/graphiql/pull/3521

Expected Behavior

Doesn't show validation error.

Steps To Reproduce

No response

Environment

  • GraphiQL Version: v0.9.3 from (https://github.com/graphql/graphiql/pull/3521)
  • OS: MacOS 14.1.1 (23B81)
  • Browser:
  • Bundler:
  • react Version:
  • graphql Version:

Anything else?

No response

gerdemb avatar Mar 25 '24 09:03 gerdemb