Skip to content

Commit

Permalink
Batch the executor in the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Feb 6, 2025
1 parent 5480395 commit 00da557
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/fusion-runtime/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
loggerForExecutionRequest,
requestIdByRequest,
} from '@graphql-mesh/utils';
import { createBatchingExecutor } from '@graphql-tools/batch-execute';
import { getBatchingExecutor } from '@graphql-tools/batch-execute';
import {
DelegationPlanBuilder,
MergedTypeResolver,
Expand Down Expand Up @@ -222,9 +222,6 @@ export function getOnSubgraphExecute({
if (isDisposable(executor_)) {
transportExecutorStack.use(executor_);
}
if (batch) {
executor = createBatchingExecutor(executor_);
}
// Wraps the transport executor with hooks
executor = wrapExecutorWithHooks({
executor: executor_,
Expand All @@ -243,6 +240,9 @@ export function getOnSubgraphExecute({
// Caches the lazy executor to prevent race conditions
subgraphExecutorMap.set(subgraphName, executor);
}
if (batch) {
executor = getBatchingExecutor(executionRequest.context || subgraphExecutorMap, executor);
}
return executor(executionRequest);
};
}
Expand Down

0 comments on commit 00da557

Please sign in to comment.