graphql / graphql/graphiql

[graphiql] Fragment variables not supported

Open
#3,568 4 comments 1 reaction 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.