Skip to content

Commit 372924d

Browse files
committed
move subscription event tracing to mapSourceToResponse
to cover custom perEventExecutors
1 parent 626813d commit 372924d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/execution/execute.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,7 @@ export function executeSync(args: ExecutionArgs): ExecutionResult {
268268
export function executeSubscriptionEvent(
269269
validatedExecutionArgs: ValidatedExecutionArgs,
270270
): PromiseOrValue<ExecutionResult> {
271-
if (!executeChannel?.hasSubscribers) {
272-
return executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
273-
}
274-
return traceMixed(
275-
executeChannel,
276-
buildExecuteCtxFromValidatedArgs(validatedExecutionArgs),
277-
() => executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs),
278-
);
271+
return executeQueryOrMutationOrSubscriptionEvent(validatedExecutionArgs);
279272
}
280273

281274
/**
@@ -624,7 +617,14 @@ function mapSourceToResponse(
624617
...validatedExecutionArgs,
625618
rootValue: payload,
626619
};
627-
return validatedExecutionArgs.perEventExecutor(perEventExecutionArgs);
620+
if (!executeChannel?.hasSubscribers) {
621+
return validatedExecutionArgs.perEventExecutor(perEventExecutionArgs);
622+
}
623+
return traceMixed(
624+
executeChannel,
625+
buildExecuteCtxFromValidatedArgs(validatedExecutionArgs),
626+
() => validatedExecutionArgs.perEventExecutor(perEventExecutionArgs),
627+
);
628628
}
629629

630630
const externalAbortSignal = validatedExecutionArgs.externalAbortSignal;

0 commit comments

Comments
 (0)