|
| 1 | +--- |
| 2 | +source: crates/biome_graphql_analyze/tests/spec_tests.rs |
| 3 | +expression: invalid.graphql |
| 4 | +--- |
| 5 | +# Input |
| 6 | +```graphql |
| 7 | +# should generate diagnostics |
| 8 | +query A { |
| 9 | + field(arg1: "value", arg1: "value") |
| 10 | +} |
| 11 | +query B { |
| 12 | + field(arg1: "value", arg1: "value", arg1: "value") |
| 13 | +} |
| 14 | +query C { |
| 15 | + field @directive(arg1: "value", arg1: "value") |
| 16 | +} |
| 17 | +query D { |
| 18 | + field @directive(arg1: "value", arg1: "value", arg1: "value") |
| 19 | +} |
| 20 | +
|
| 21 | +``` |
| 22 | + |
| 23 | +# Diagnostics |
| 24 | +``` |
| 25 | +invalid.graphql:3:7 lint/nursery/useUniqueArgumentNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 26 | +
|
| 27 | + i Duplicate argument name. |
| 28 | + |
| 29 | + 1 │ # should generate diagnostics |
| 30 | + 2 │ query A { |
| 31 | + > 3 │ field(arg1: "value", arg1: "value") |
| 32 | + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 33 | + 4 │ } |
| 34 | + 5 │ query B { |
| 35 | + |
| 36 | + i A GraphQL field or directive is only valid if all supplied arguments are uniquely named. Make sure to name every argument differently. |
| 37 | + |
| 38 | + i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information. |
| 39 | + |
| 40 | +
|
| 41 | +``` |
| 42 | +
|
| 43 | +``` |
| 44 | +invalid.graphql:6:7 lint/nursery/useUniqueArgumentNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 45 | +
|
| 46 | + i Duplicate argument name. |
| 47 | + |
| 48 | + 4 │ } |
| 49 | + 5 │ query B { |
| 50 | + > 6 │ field(arg1: "value", arg1: "value", arg1: "value") |
| 51 | + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 52 | + 7 │ } |
| 53 | + 8 │ query C { |
| 54 | + |
| 55 | + i A GraphQL field or directive is only valid if all supplied arguments are uniquely named. Make sure to name every argument differently. |
| 56 | + |
| 57 | + i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information. |
| 58 | + |
| 59 | +
|
| 60 | +``` |
| 61 | +
|
| 62 | +``` |
| 63 | +invalid.graphql:9:18 lint/nursery/useUniqueArgumentNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 64 | +
|
| 65 | + i Duplicate argument name. |
| 66 | + |
| 67 | + 7 │ } |
| 68 | + 8 │ query C { |
| 69 | + > 9 │ field @directive(arg1: "value", arg1: "value") |
| 70 | + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 71 | + 10 │ } |
| 72 | + 11 │ query D { |
| 73 | + |
| 74 | + i A GraphQL field or directive is only valid if all supplied arguments are uniquely named. Make sure to name every argument differently. |
| 75 | + |
| 76 | + i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information. |
| 77 | + |
| 78 | +
|
| 79 | +``` |
| 80 | +
|
| 81 | +``` |
| 82 | +invalid.graphql:12:18 lint/nursery/useUniqueArgumentNames ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ |
| 83 | +
|
| 84 | + i Duplicate argument name. |
| 85 | + |
| 86 | + 10 │ } |
| 87 | + 11 │ query D { |
| 88 | + > 12 │ field @directive(arg1: "value", arg1: "value", arg1: "value") |
| 89 | + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 90 | + 13 │ } |
| 91 | + 14 │ |
| 92 | + |
| 93 | + i A GraphQL field or directive is only valid if all supplied arguments are uniquely named. Make sure to name every argument differently. |
| 94 | + |
| 95 | + i This rule belongs to the nursery group, which means it is not yet stable and may change in the future. Visit https://biomejs.dev/linter/#nursery for more information. |
| 96 | + |
| 97 | +
|
| 98 | +``` |
0 commit comments