File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Sources/GraphQL/Validation Expand file tree Collapse file tree 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 {
165165 }
166166
167167 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+ // }
171173
172174 var spreads = [ FragmentSpread] ( )
173175 var setsToVisit : [ SelectionSet ] = [ node]
@@ -176,19 +178,18 @@ public final class ValidationContext {
176178 for selection in set. selections {
177179 if let selection = selection as? FragmentSpread {
178180 spreads. append ( selection)
179- }
180-
181- if let selection = selection as? InlineFragment {
181+ } else if let selection = selection as? InlineFragment {
182182 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+ {
186187 setsToVisit. append ( selectionSet)
187188 }
188189 }
189190 }
190191
191- fragmentSpreads [ node] = spreads
192+ // fragmentSpreads[node] = spreads
192193 return spreads
193194 }
194195
You can’t perform that action at this time.
0 commit comments