Skip to content

Commit

Permalink
Fix adding context to page query results
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Apr 20, 2018
1 parent e7f70da commit e9c3027
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ module.exports = async (queryJob, component) => {
}
}

// Add the page context onto the results.
if (queryJob?.isPage) {
result[`pageContext`] = queryJob.context
}

const resultJSON = JSON.stringify(result)
const resultHash = require("crypto")
.createHash("sha1")
Expand All @@ -58,8 +63,6 @@ module.exports = async (queryJob, component) => {

let dataPath
if (queryJob?.isPage) {
// Add the page context onto the results.
result[`pageContext`] = queryJob.context
dataPath = `${generatePathChunkName(queryJob.jsonName)}-${resultHash}`
} else {
dataPath = queryJob.hash
Expand Down

0 comments on commit e9c3027

Please sign in to comment.