diff --git a/packages/gatsby/src/redux/index.js b/packages/gatsby/src/redux/index.js index 036ac2c19f6af..64d6fce0d09ce 100644 --- a/packages/gatsby/src/redux/index.js +++ b/packages/gatsby/src/redux/index.js @@ -48,6 +48,7 @@ const trackInlineObjectsInRootNode = node => { } addRootNodeToInlineObject(v, node.id) }) + return node } exports.trackInlineObjectsInRootNode = trackInlineObjectsInRootNode diff --git a/packages/gatsby/src/schema/run-sift.js b/packages/gatsby/src/schema/run-sift.js index 9b3119630975a..b6f498913cc9d 100644 --- a/packages/gatsby/src/schema/run-sift.js +++ b/packages/gatsby/src/schema/run-sift.js @@ -5,6 +5,7 @@ const { connectionFromArray } = require(`graphql-skip-limit`) const { createPageDependency } = require(`../redux/actions/add-page-dependency`) const prepareRegex = require(`./prepare-regex`) const Promise = require(`bluebird`) +const { trackInlineObjectsInRootNode } = require(`../redux`) function awaitSiftField(fields, node, k) { const field = fields[k] @@ -109,6 +110,7 @@ module.exports = ({ return Promise.all( nodes.map(node => resolveRecursive(node, fieldsToSift, type.getFields())) ).then(myNodes => { + myNodes = myNodes.map(trackInlineObjectsInRootNode) if (!connection) { const index = _.isEmpty(siftArgs) ? 0