File tree 1 file changed +11
-10
lines changed
Sources/GraphQL/Validation
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -165,9 +165,11 @@ public final class ValidationContext {
165
165
}
166
166
167
167
public func getFragmentSpreads( node: SelectionSet ) -> [ FragmentSpread ] {
168
- if let spreads = fragmentSpreads [ node] {
169
- return spreads
170
- }
168
+ // Uncommenting this creates unpredictably wrong fragment path matching.
169
+ // Failures can be seen in NoFragmentCyclesRuleTests.testNoSpreadingItselfDeeplyTwoPaths
170
+ // if let spreads = fragmentSpreads[node] {
171
+ // return spreads
172
+ // }
171
173
172
174
var spreads = [ FragmentSpread] ( )
173
175
var setsToVisit : [ SelectionSet ] = [ node]
@@ -176,19 +178,18 @@ public final class ValidationContext {
176
178
for selection in set. selections {
177
179
if let selection = selection as? FragmentSpread {
178
180
spreads. append ( selection)
179
- }
180
-
181
- if let selection = selection as? InlineFragment {
181
+ } else if let selection = selection as? InlineFragment {
182
182
setsToVisit. append ( selection. selectionSet)
183
- }
184
-
185
- if let selection = selection as? Field , let selectionSet = selection. selectionSet {
183
+ } else if
184
+ let selection = selection as? Field ,
185
+ let selectionSet = selection. selectionSet
186
+ {
186
187
setsToVisit. append ( selectionSet)
187
188
}
188
189
}
189
190
}
190
191
191
- fragmentSpreads [ node] = spreads
192
+ // fragmentSpreads[node] = spreads
192
193
return spreads
193
194
}
194
195
You can’t perform that action at this time.
0 commit comments