...
1- name: of the same object
2 rule: PossibleFragmentSpreads
3 schema: 0
4 query: |2-
5
6 fragment objectWithinObject on Dog { ...dogFragment }
7 fragment dogFragment on Dog { barkVolume }
8
9 errors: []
10- name: of the same object with inline fragment
11 rule: PossibleFragmentSpreads
12 schema: 0
13 query: |2-
14
15 fragment objectWithinObjectAnon on Dog { ... on Dog { barkVolume } }
16
17 errors: []
18- name: object into an implemented interface
19 rule: PossibleFragmentSpreads
20 schema: 0
21 query: |2-
22
23 fragment objectWithinInterface on Pet { ...dogFragment }
24 fragment dogFragment on Dog { barkVolume }
25
26 errors: []
27- name: object into containing union
28 rule: PossibleFragmentSpreads
29 schema: 0
30 query: |2-
31
32 fragment objectWithinUnion on CatOrDog { ...dogFragment }
33 fragment dogFragment on Dog { barkVolume }
34
35 errors: []
36- name: union into contained object
37 rule: PossibleFragmentSpreads
38 schema: 0
39 query: |2-
40
41 fragment unionWithinObject on Dog { ...catOrDogFragment }
42 fragment catOrDogFragment on CatOrDog { __typename }
43
44 errors: []
45- name: union into overlapping interface
46 rule: PossibleFragmentSpreads
47 schema: 0
48 query: |2-
49
50 fragment unionWithinInterface on Pet { ...catOrDogFragment }
51 fragment catOrDogFragment on CatOrDog { __typename }
52
53 errors: []
54- name: union into overlapping union
55 rule: PossibleFragmentSpreads
56 schema: 0
57 query: |2-
58
59 fragment unionWithinUnion on DogOrHuman { ...catOrDogFragment }
60 fragment catOrDogFragment on CatOrDog { __typename }
61
62 errors: []
63- name: interface into implemented object
64 rule: PossibleFragmentSpreads
65 schema: 0
66 query: |2-
67
68 fragment interfaceWithinObject on Dog { ...petFragment }
69 fragment petFragment on Pet { name }
70
71 errors: []
72- name: interface into overlapping interface
73 rule: PossibleFragmentSpreads
74 schema: 0
75 query: |2-
76
77 fragment interfaceWithinInterface on Pet { ...beingFragment }
78 fragment beingFragment on Being { name }
79
80 errors: []
81- name: interface into overlapping interface in inline fragment
82 rule: PossibleFragmentSpreads
83 schema: 0
84 query: |2-
85
86 fragment interfaceWithinInterface on Pet { ... on Being { name } }
87
88 errors: []
89- name: interface into overlapping union
90 rule: PossibleFragmentSpreads
91 schema: 0
92 query: |2-
93
94 fragment interfaceWithinUnion on CatOrDog { ...petFragment }
95 fragment petFragment on Pet { name }
96
97 errors: []
98- name: ignores incorrect type (caught by FragmentsOnCompositeTypes)
99 rule: PossibleFragmentSpreads
100 schema: 0
101 query: |2-
102
103 fragment petFragment on Pet { ...badInADifferentWay }
104 fragment badInADifferentWay on String { name }
105
106 errors: []
107- name: different object into object
108 rule: PossibleFragmentSpreads
109 schema: 0
110 query: |2-
111
112 fragment invalidObjectWithinObject on Cat { ...dogFragment }
113 fragment dogFragment on Dog { barkVolume }
114
115 errors:
116 - message: Fragment "dogFragment" cannot be spread here as objects of type "Cat" can never be of type "Dog".
117 locations:
118 - {line: 2, column: 51}
119- name: different object into object in inline fragment
120 rule: PossibleFragmentSpreads
121 schema: 0
122 query: |2-
123
124 fragment invalidObjectWithinObjectAnon on Cat {
125 ... on Dog { barkVolume }
126 }
127
128 errors:
129 - message: Fragment cannot be spread here as objects of type "Cat" can never be of type "Dog".
130 locations:
131 - {line: 3, column: 9}
132- name: object into not implementing interface
133 rule: PossibleFragmentSpreads
134 schema: 0
135 query: |2-
136
137 fragment invalidObjectWithinInterface on Pet { ...humanFragment }
138 fragment humanFragment on Human { pets { name } }
139
140 errors:
141 - message: Fragment "humanFragment" cannot be spread here as objects of type "Pet" can never be of type "Human".
142 locations:
143 - {line: 2, column: 54}
144- name: object into not containing union
145 rule: PossibleFragmentSpreads
146 schema: 0
147 query: |2-
148
149 fragment invalidObjectWithinUnion on CatOrDog { ...humanFragment }
150 fragment humanFragment on Human { pets { name } }
151
152 errors:
153 - message: Fragment "humanFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "Human".
154 locations:
155 - {line: 2, column: 55}
156- name: union into not contained object
157 rule: PossibleFragmentSpreads
158 schema: 0
159 query: |2-
160
161 fragment invalidUnionWithinObject on Human { ...catOrDogFragment }
162 fragment catOrDogFragment on CatOrDog { __typename }
163
164 errors:
165 - message: Fragment "catOrDogFragment" cannot be spread here as objects of type "Human" can never be of type "CatOrDog".
166 locations:
167 - {line: 2, column: 52}
168- name: union into non overlapping interface
169 rule: PossibleFragmentSpreads
170 schema: 0
171 query: |2-
172
173 fragment invalidUnionWithinInterface on Pet { ...humanOrAlienFragment }
174 fragment humanOrAlienFragment on HumanOrAlien { __typename }
175
176 errors:
177 - message: Fragment "humanOrAlienFragment" cannot be spread here as objects of type "Pet" can never be of type "HumanOrAlien".
178 locations:
179 - {line: 2, column: 53}
180- name: union into non overlapping union
181 rule: PossibleFragmentSpreads
182 schema: 0
183 query: |2-
184
185 fragment invalidUnionWithinUnion on CatOrDog { ...humanOrAlienFragment }
186 fragment humanOrAlienFragment on HumanOrAlien { __typename }
187
188 errors:
189 - message: Fragment "humanOrAlienFragment" cannot be spread here as objects of type "CatOrDog" can never be of type "HumanOrAlien".
190 locations:
191 - {line: 2, column: 54}
192- name: interface into non implementing object
193 rule: PossibleFragmentSpreads
194 schema: 0
195 query: |2-
196
197 fragment invalidInterfaceWithinObject on Cat { ...intelligentFragment }
198 fragment intelligentFragment on Intelligent { iq }
199
200 errors:
201 - message: Fragment "intelligentFragment" cannot be spread here as objects of type "Cat" can never be of type "Intelligent".
202 locations:
203 - {line: 2, column: 54}
204- name: interface into non overlapping interface
205 rule: PossibleFragmentSpreads
206 schema: 0
207 query: |2-
208
209 fragment invalidInterfaceWithinInterface on Pet {
210 ...intelligentFragment
211 }
212 fragment intelligentFragment on Intelligent { iq }
213
214 errors:
215 - message: Fragment "intelligentFragment" cannot be spread here as objects of type "Pet" can never be of type "Intelligent".
216 locations:
217 - {line: 3, column: 9}
218- name: interface into non overlapping interface in inline fragment
219 rule: PossibleFragmentSpreads
220 schema: 0
221 query: |2-
222
223 fragment invalidInterfaceWithinInterfaceAnon on Pet {
224 ...on Intelligent { iq }
225 }
226
227 errors:
228 - message: Fragment cannot be spread here as objects of type "Pet" can never be of type "Intelligent".
229 locations:
230 - {line: 3, column: 9}
231- name: interface into non overlapping union
232 rule: PossibleFragmentSpreads
233 schema: 0
234 query: |2-
235
236 fragment invalidInterfaceWithinUnion on HumanOrAlien { ...petFragment }
237 fragment petFragment on Pet { name }
238
239 errors:
240 - message: Fragment "petFragment" cannot be spread here as objects of type "HumanOrAlien" can never be of type "Pet".
241 locations:
242 - {line: 2, column: 62}
View as plain text