unique-operation-name
What it does
Section titled “What it does”Reports two operations of a document with the same name, within one file.
Why it matters
Section titled “Why it matters”A server cannot tell which operation a request with that name runs, and tools that key on the name (caches, persisted queries, generated code) collide.
To fix, rename one of them.
Example
Section titled “Example”query A { a }query A { b }query B { c }fragment F on T { a }...Configuration
Section titled “Configuration”graphql: lint: rules: unique-operation-name: error # off, warn, error (default)Suppress one line with sudsy-disable-next-line unique-operation-name in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| graphql-eslint | unique-operation-name |
partial | Not checked across files. |