Skip to content

Commit c5cea56

Browse files
committed
fix(demand-control): support proxy mode
1 parent 19a6cc4 commit c5cea56

File tree

2 files changed

+1032
-1070
lines changed

2 files changed

+1032
-1070
lines changed

packages/runtime/src/plugins/useDemandControl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ export function useDemandControl<TContext extends Record<string, any>>({
7070
const costByContextMap = new WeakMap<any, number>();
7171
return {
7272
onSubgraphExecute({ subgraph, executionRequest, log }) {
73+
if (!subgraph) {
74+
return;
75+
}
7376
let costByContext = executionRequest.context
7477
? costByContextMap.get(executionRequest.context) || 0
7578
: 0;

0 commit comments

Comments
 (0)