@graphql-tools/delegate 12.0.15 → 12.0.16-alpha-543a0b9a2221fdc5b35aebcc397631f5145aedc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +5 -8
- package/dist/index.js +5 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @graphql-tools/delegate
|
|
2
2
|
|
|
3
|
+
## 12.0.16-alpha-543a0b9a2221fdc5b35aebcc397631f5145aedc3
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [#2320](https://github.com/graphql-hive/gateway/pull/2320) [`61b9271`](https://github.com/graphql-hive/gateway/commit/61b9271be928551ecb321c60acf2516120d29908) Thanks [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent)! - Fix `@stream` directive not working for federated subgraphs with non-null scalar list return types.
|
|
9
|
+
|
|
10
|
+
Two bugs were addressed in `delegateRequest`:
|
|
11
|
+
|
|
12
|
+
1. `isListType` was called without first unwrapping `NonNull`, so a field typed `[String!]!` (a `NonNull(List(...))`) was not recognised as a list. The fix wraps the check with `getNullableType()`.
|
|
13
|
+
|
|
14
|
+
2. Deduplication of already-pushed stream items used a `WeakSet`, which throws a `TypeError` for primitive values (strings, numbers, etc.). This was replaced with an integer index counter that works for both object and primitive list items.
|
|
15
|
+
|
|
3
16
|
## 12.0.15
|
|
4
17
|
### Patch Changes
|
|
5
18
|
|
package/dist/index.cjs
CHANGED
|
@@ -2647,9 +2647,9 @@ function delegateRequest(options) {
|
|
|
2647
2647
|
() => getExecutor(delegationContext)(processedRequest),
|
|
2648
2648
|
function handleExecutorResult(executorResult) {
|
|
2649
2649
|
if (utils.isAsyncIterable(executorResult)) {
|
|
2650
|
-
if (delegationContext.operation === "query" && graphql.isListType(delegationContext.returnType)) {
|
|
2650
|
+
if (delegationContext.operation === "query" && graphql.isListType(graphql.getNullableType(delegationContext.returnType))) {
|
|
2651
2651
|
return new repeater.Repeater(async (push, stop) => {
|
|
2652
|
-
|
|
2652
|
+
let pushedCount = 0;
|
|
2653
2653
|
let stopped = false;
|
|
2654
2654
|
stop.finally(() => {
|
|
2655
2655
|
stopped = true;
|
|
@@ -2681,15 +2681,12 @@ function delegateRequest(options) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
const transformedResult = await transformer.transformResult(result);
|
|
2683
2683
|
if (Array.isArray(transformedResult)) {
|
|
2684
|
-
for (
|
|
2684
|
+
for (let i = pushedCount; i < transformedResult.length; i++) {
|
|
2685
2685
|
if (stopped) {
|
|
2686
2686
|
break;
|
|
2687
2687
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
pushed.add(individualResult);
|
|
2691
|
-
await push(individualResult);
|
|
2692
|
-
}
|
|
2688
|
+
pushedCount++;
|
|
2689
|
+
await push(await transformedResult[i]);
|
|
2693
2690
|
}
|
|
2694
2691
|
} else {
|
|
2695
2692
|
await push(await transformedResult);
|
package/dist/index.js
CHANGED
|
@@ -2647,9 +2647,9 @@ function delegateRequest(options) {
|
|
|
2647
2647
|
() => getExecutor(delegationContext)(processedRequest),
|
|
2648
2648
|
function handleExecutorResult(executorResult) {
|
|
2649
2649
|
if (isAsyncIterable(executorResult)) {
|
|
2650
|
-
if (delegationContext.operation === "query" && isListType(delegationContext.returnType)) {
|
|
2650
|
+
if (delegationContext.operation === "query" && isListType(getNullableType(delegationContext.returnType))) {
|
|
2651
2651
|
return new Repeater(async (push, stop) => {
|
|
2652
|
-
|
|
2652
|
+
let pushedCount = 0;
|
|
2653
2653
|
let stopped = false;
|
|
2654
2654
|
stop.finally(() => {
|
|
2655
2655
|
stopped = true;
|
|
@@ -2681,15 +2681,12 @@ function delegateRequest(options) {
|
|
|
2681
2681
|
}
|
|
2682
2682
|
const transformedResult = await transformer.transformResult(result);
|
|
2683
2683
|
if (Array.isArray(transformedResult)) {
|
|
2684
|
-
for (
|
|
2684
|
+
for (let i = pushedCount; i < transformedResult.length; i++) {
|
|
2685
2685
|
if (stopped) {
|
|
2686
2686
|
break;
|
|
2687
2687
|
}
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
pushed.add(individualResult);
|
|
2691
|
-
await push(individualResult);
|
|
2692
|
-
}
|
|
2688
|
+
pushedCount++;
|
|
2689
|
+
await push(await transformedResult[i]);
|
|
2693
2690
|
}
|
|
2694
2691
|
} else {
|
|
2695
2692
|
await push(await transformedResult);
|
package/package.json
CHANGED