File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/gatsby/src/query Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ const determineUsedFragmentsForDefinition = (
431
431
definition ,
432
432
definitionsByName ,
433
433
fragmentsUsedByFragment ,
434
- visitedFragmentDefinitions = new Set ( )
434
+ visitedFragments = new Set ( )
435
435
) => {
436
436
const { def, name, isFragment, filePath } = definition
437
437
const cachedUsedFragments = fragmentsUsedByFragment . get ( name )
@@ -444,11 +444,11 @@ const determineUsedFragmentsForDefinition = (
444
444
[ Kind . FRAGMENT_SPREAD ] : node => {
445
445
const name = node . name . value
446
446
const fragmentDefinition = definitionsByName . get ( name )
447
- if ( visitedFragmentDefinitions . has ( fragmentDefinition ) ) {
448
- return
449
- }
450
- visitedFragmentDefinitions . add ( fragmentDefinition )
451
447
if ( fragmentDefinition ) {
448
+ if ( visitedFragments . has ( name ) ) {
449
+ return
450
+ }
451
+ visitedFragments . add ( name )
452
452
usedFragments . add ( name )
453
453
const {
454
454
usedFragments : usedFragmentsForFragment ,
@@ -457,7 +457,7 @@ const determineUsedFragmentsForDefinition = (
457
457
fragmentDefinition ,
458
458
definitionsByName ,
459
459
fragmentsUsedByFragment ,
460
- visitedFragmentDefinitions
460
+ visitedFragments
461
461
)
462
462
usedFragmentsForFragment . forEach ( fragmentName =>
463
463
usedFragments . add ( fragmentName )
You can’t perform that action at this time.
0 commit comments