Fix "variable never used in operation" error #8

Merged
belka merged 1 commits from prescientmoon/graphql:master into master 2023-12-27 13:32:12 +01:00
Contributor

Consider the following query

query withVar ($name: String) {
  todos (filter: {name: {eq: $name}}) {
    name, description, completed
  }
}

Currently, the following error is produced

{
  "data": null,
  "errors": [
    {
      "locations": [
        {
          "column": 16,
          "line": 1
        }
      ],
      "message": "Variable \"$name\" is never used in operation \"withVar\"."
    }
  ]
}

This PR is not polished by any means (I just threw together a quick fix). Feel free to add a test and whatnot (I'm not super familiar with the project structure).

Consider the following query ```gql query withVar ($name: String) { todos (filter: {name: {eq: $name}}) { name, description, completed } } ``` Currently, the following error is produced ```json { "data": null, "errors": [ { "locations": [ { "column": 16, "line": 1 } ], "message": "Variable \"$name\" is never used in operation \"withVar\"." } ] } ``` This PR is not polished by any means (I just threw together a quick fix). Feel free to add a test and whatnot (I'm not super familiar with the project structure).
prescientmoon added 1 commit 2023-12-15 05:20:12 +01:00
Fix "variable is not used" error
Some checks failed
Build / test (pull_request) Has been cancelled
Build / doc (pull_request) Has been cancelled
Build / audit (pull_request) Has been cancelled
4063d48a37
belka force-pushed master from 4063d48a37 to 59aa010f0b 2023-12-27 12:50:21 +01:00 Compare
belka merged commit 59aa010f0b into master 2023-12-27 13:32:12 +01:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: OSS/graphql#8
No description provided.