Skip to content

Commit

Permalink
Add a hot fix for missing fragment definition regression
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee committed Jan 31, 2020
1 parent 0e413cb commit 6b31ea3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby/src/query/query-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ const determineUsedFragmentsForDefinition = (
) => {
const { def, name, isFragment, filePath } = definition
const cachedUsedFragments = fragmentsUsedByFragment.get(name)
if (cachedUsedFragments) {

// `cachedUsedFragments` could be a Set with size 0 which happens to be truthy
if (cachedUsedFragments?.size) {
return { usedFragments: cachedUsedFragments, missingFragments: [] }
} else {
const usedFragments = new Set()
Expand Down

0 comments on commit 6b31ea3

Please sign in to comment.