...
1- name: no operations
2 rule: UniqueOperationNames
3 schema: 0
4 query: |2-
5
6 fragment fragA on Type {
7 field
8 }
9
10 errors: []
11- name: one anon operation
12 rule: UniqueOperationNames
13 schema: 0
14 query: |2-
15
16 {
17 field
18 }
19
20 errors: []
21- name: one named operation
22 rule: UniqueOperationNames
23 schema: 0
24 query: |2-
25
26 query Foo {
27 field
28 }
29
30 errors: []
31- name: multiple operations
32 rule: UniqueOperationNames
33 schema: 0
34 query: |2-
35
36 query Foo {
37 field
38 }
39
40 query Bar {
41 field
42 }
43
44 errors: []
45- name: multiple operations of different types
46 rule: UniqueOperationNames
47 schema: 0
48 query: |2-
49
50 query Foo {
51 field
52 }
53
54 mutation Bar {
55 field
56 }
57
58 subscription Baz {
59 field
60 }
61
62 errors: []
63- name: fragment and operation named the same
64 rule: UniqueOperationNames
65 schema: 0
66 query: |2-
67
68 query Foo {
69 ...Foo
70 }
71 fragment Foo on Type {
72 field
73 }
74
75 errors: []
76- name: multiple operations of same name
77 rule: UniqueOperationNames
78 schema: 0
79 query: |2-
80
81 query Foo {
82 fieldA
83 }
84 query Foo {
85 fieldB
86 }
87
88 errors:
89 - message: There can be only one operation named "Foo".
90 locations:
91 - {line: 2, column: 13}
92 - {line: 5, column: 13}
93- name: multiple ops of same name of different types (mutation)
94 rule: UniqueOperationNames
95 schema: 0
96 query: |2-
97
98 query Foo {
99 fieldA
100 }
101 mutation Foo {
102 fieldB
103 }
104
105 errors:
106 - message: There can be only one operation named "Foo".
107 locations:
108 - {line: 2, column: 13}
109 - {line: 5, column: 16}
110- name: multiple ops of same name of different types (subscription)
111 rule: UniqueOperationNames
112 schema: 0
113 query: |2-
114
115 query Foo {
116 fieldA
117 }
118 subscription Foo {
119 fieldB
120 }
121
122 errors:
123 - message: There can be only one operation named "Foo".
124 locations:
125 - {line: 2, column: 13}
126 - {line: 5, column: 20}
View as plain text