Skip to content

Commit

Permalink
bring back destructured parentSpan for inc builds
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten committed May 13, 2020
1 parent 58b1518 commit 75f4883
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby/src/query/graphql-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class GraphQLRunner {
let tracer
if (this.graphqlTracing && parentSpan) {
tracer = new GraphQLSpanTracer(`GraphQL Query`, {
parentSpan: parentSpan,
parentSpan,
tags: {
queryName: queryName,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/src/query/query-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ interface IExecutionResult extends ExecutionResult {
export const queryRunner = async (
graphqlRunner: GraphQLRunner,
queryJob: IQueryJob,
parentSpan: Span | undefined
{ parentSpan }: { parentSpan: Span | undefined }
): Promise<IExecutionResult> => {
const { program } = store.getState()

Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby/src/query/queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const createBuildQueue = (graphqlRunner, runnerOptions = {}) => {
graphqlRunner = new GraphQLRunner(store, runnerOptions)
}
const handler = ({ job, activity }, callback) =>
queryRunner(graphqlRunner, job, activity?.span)
queryRunner(graphqlRunner, job, { parentSpan: activity?.span })
.then(result => callback(null, result))
.catch(callback)
const queue = new Queue(handler, createBaseOptions())
Expand All @@ -41,7 +41,7 @@ const createDevelopQueue = getRunner => {
}

const handler = ({ job: queryJob, activity }, callback) => {
queryRunner(getRunner(), queryJob, activity?.span).then(
queryRunner(getRunner(), queryJob, { parentSpan: activity?.span }).then(
result => {
if (queryJob.isPage) {
websocketManager.emitPageData({
Expand Down

0 comments on commit 75f4883

Please sign in to comment.