Skip to content

Commit 489c9bf

Browse files
committed
add TODOs
by splitting prior to externalValue creation we will be able to use the correct info
1 parent c004429 commit 489c9bf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/batch-delegate/src/getLoader.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ function createBatchFn<K = any>(options: BatchDelegateOptions) {
8181
});
8282

8383
if (isAsyncIterable(batchResult)) {
84+
// TODO: split the asyncIterable and make a new receiver from each of them, return the Receiver instead of the
85+
// initial value, so that the correct info can be used to instantiate the Receiver
8486
const receiver = new InitialReceiver(batchResult, delegationContext, executionResult => transformer.transformResult(executionResult));
8587

8688
const { data, unpathedErrors } = await receiver.getInitialResult();
@@ -92,7 +94,9 @@ function createBatchFn<K = any>(options: BatchDelegateOptions) {
9294
return Array.isArray(batchValue) ? batchValue : keys.map(() => batchValue);
9395
}
9496

95-
const batchValue = externalValueFromResult(transformer.transformResult(batchResult), delegationContext);
97+
// TODO: split the batchedResult and return the result instead of the value, so the correct info
98+
// can be used to instantiate the value
99+
const batchValue = externalValueFromResult(transformer.transformResult(batchResult), delegationContext);
96100

97101
return Array.isArray(batchValue) ? batchValue : keys.map(() => batchValue);
98102
};

0 commit comments

Comments
 (0)