@@ -485,24 +485,27 @@ function findConflictsBetweenSubSelectionSets(
485
485
486
486
// (E) Then collect any conflicts between the provided collection of fields
487
487
// and any fragment names found in the given fragment.
488
- const processDiscoveredFragments = (
488
+ function processDiscoveredFragments (
489
489
context : ValidationContext ,
490
490
conflicts : Array < Conflict > ,
491
491
cachedFieldsAndFragmentNames : Map < SelectionSetNode , FieldsAndFragmentNames > ,
492
492
comparedFragmentPairs : PairSet ,
493
493
areMutuallyExclusive : boolean ,
494
494
fieldMap : NodeAndDefCollection ,
495
495
discoveredFragments : Array < Array < string > > ,
496
- ) => {
497
- while ( discoveredFragments . length !== 0 ) {
498
- const item = discoveredFragments . pop ( ) ;
496
+ ) {
497
+ let item ;
498
+ while ( ( item = discoveredFragments . pop ( ) ) !== undefined ) {
499
+ const [ fragmentName , referencedFragmentName ] = item ;
499
500
if (
500
- ! item ||
501
- comparedFragmentPairs . has ( item [ 1 ] , item [ 0 ] , areMutuallyExclusive )
501
+ comparedFragmentPairs . has (
502
+ referencedFragmentName ,
503
+ fragmentName ,
504
+ areMutuallyExclusive ,
505
+ )
502
506
) {
503
507
continue ;
504
508
}
505
- const [ fragmentName , referencedFragmentName ] = item ;
506
509
comparedFragmentPairs . add (
507
510
referencedFragmentName ,
508
511
fragmentName ,
0 commit comments