noUnusedVariables
| Property | Value |
|---|---|
| Config name | noUnusedVariables |
| Default severity | — |
| Context | Document |
| In recommended | No |
What it checks
Section titled “What it checks”Detects variables defined in an operation that are never referenced in the query body.
Examples
Section titled “Examples”# ⚠️ Warning: Variable '$name' is never usedquery GetUser($id: ID!, $name: String) { user(id: $id) { id }}# ✅ Good — all variables usedquery GetUser($id: ID!) { user(id: $id) { id }}Configuration
Section titled “Configuration”extensions: graphql-analyzer: lint: rules: noUnusedVariables: warn # or error, off