@@ -95,7 +95,7 @@ export class ValidationContext {
9595 _typeInfo : TypeInfo ;
9696 _errors : Array < GraphQLError > ;
9797 _fragments : { [ name : string ] : FragmentDefinition } ;
98- _fragmentSpreads : Map < HasSelectionSet , Array < FragmentSpread >> ;
98+ _fragmentSpreads : Map < SelectionSet , Array < FragmentSpread >> ;
9999 _recursivelyReferencedFragments :
100100 Map < OperationDefinition , Array < FragmentDefinition >> ;
101101 _variableUsages : Map < HasSelectionSet , Array < VariableUsage >> ;
@@ -142,11 +142,11 @@ export class ValidationContext {
142142 return fragments [ name ] ;
143143 }
144144
145- getFragmentSpreads ( node : HasSelectionSet ) : Array < FragmentSpread > {
145+ getFragmentSpreads ( node : SelectionSet ) : Array < FragmentSpread > {
146146 let spreads = this . _fragmentSpreads . get ( node ) ;
147147 if ( ! spreads ) {
148148 spreads = [ ] ;
149- const setsToVisit : Array < SelectionSet > = [ node . selectionSet ] ;
149+ const setsToVisit : Array < SelectionSet > = [ node ] ;
150150 while ( setsToVisit . length !== 0 ) {
151151 const set = setsToVisit . pop ( ) ;
152152 for ( let i = 0 ; i < set . selections . length ; i ++ ) {
@@ -170,7 +170,7 @@ export class ValidationContext {
170170 if ( ! fragments ) {
171171 fragments = [ ] ;
172172 const collectedNames = Object . create ( null ) ;
173- const nodesToVisit : Array < HasSelectionSet > = [ operation ] ;
173+ const nodesToVisit : Array < SelectionSet > = [ operation . selectionSet ] ;
174174 while ( nodesToVisit . length !== 0 ) {
175175 const node = nodesToVisit . pop ( ) ;
176176 const spreads = this . getFragmentSpreads ( node ) ;
@@ -181,7 +181,7 @@ export class ValidationContext {
181181 const fragment = this . getFragment ( fragName ) ;
182182 if ( fragment ) {
183183 fragments . push ( fragment ) ;
184- nodesToVisit . push ( fragment ) ;
184+ nodesToVisit . push ( fragment . selectionSet ) ;
185185 }
186186 }
187187 }
0 commit comments