Skip to content

Commit

Permalink
fix(gatsby): Hide page/static queries activities for PQR (#32361)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Jul 14, 2021
1 parent d576cc2 commit d65de41
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions packages/gatsby/src/services/run-page-queries.ts
Expand Up @@ -41,7 +41,10 @@ export async function runPageQueries({
}
)

activity.start()
// TODO: This is hacky, remove with a refactor of PQR itself
if (!process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING) {
activity.start()
}

let cancelNotice: CancelExperimentNoticeCallbackOrUndefined
if (
Expand Down Expand Up @@ -81,5 +84,7 @@ modules.exports = {
cancelNotice()
}

activity.done()
if (!process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING) {
activity.done()
}
}
10 changes: 8 additions & 2 deletions packages/gatsby/src/services/run-static-queries.ts
Expand Up @@ -31,13 +31,19 @@ export async function runStaticQueries({
}
)

activity.start()
// TODO: This is hacky, remove with a refactor of PQR itself
if (!process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING) {
activity.start()
}

await processStaticQueries(staticQueryIds, {
state,
activity,
graphqlRunner,
graphqlTracing: program?.graphqlTracing,
})

activity.done()
if (!process.env.GATSBY_EXPERIMENTAL_PARALLEL_QUERY_RUNNING) {
activity.done()
}
}

0 comments on commit d65de41

Please sign in to comment.