unique-fragment-name
What it does
Section titled “What it does”Reports two fragments of a document with the same name, within one file.
Why it matters
Section titled “Why it matters”A spread names the fragment it means, and with two of one name the tool cannot tell which, so it takes one or fails depending on the order. Code generators write one type per fragment name and collide.
To fix, rename one of them.
Example
Section titled “Example”...query B { c }fragment F on T { a }fragment F on T { b }Configuration
Section titled “Configuration”graphql: lint: rules: unique-fragment-name: error # off, warn, error (default)Suppress one line with sudsy-disable-next-line unique-fragment-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-fragment-name |
partial | Not checked across files. |