@graphql-tools/executor 2.0.0-alpha-20240606144658-8963c8b8f661638eaee0e101a55f3b6e46cc03ff → 2.0.0-alpha-20240606224953-6d3be8381f7a6b24f2793457d1f05f89f1ae953a

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.
@@ -56,7 +56,7 @@ class IncrementalPublisher {
56
56
  _subscribe() {
57
57
  let isDone = false;
58
58
  this._context.signal?.addEventListener('abort', () => {
59
- isDone = true;
59
+ this._incrementalGraph.completedIncrementalData().return();
60
60
  });
61
61
  const _next = async () => {
62
62
  if (isDone) {
@@ -74,9 +74,6 @@ class IncrementalPublisher {
74
74
  const asyncIterator = completedIncrementalData[Symbol.asyncIterator]();
75
75
  let iteration = await asyncIterator.next();
76
76
  while (!iteration.done) {
77
- if (this._context.signal?.aborted) {
78
- throw this._context.signal.reason;
79
- }
80
77
  for (const completedResult of iteration.value) {
81
78
  this._handleCompletedIncrementalData(completedResult, context);
82
79
  }
@@ -103,6 +100,9 @@ class IncrementalPublisher {
103
100
  }
104
101
  iteration = await asyncIterator.next();
105
102
  }
103
+ if (this._context.signal?.aborted) {
104
+ throw this._context.signal.reason;
105
+ }
106
106
  await this._returnAsyncIteratorsIgnoringErrors();
107
107
  return { value: undefined, done: true };
108
108
  };
@@ -52,7 +52,7 @@ class IncrementalPublisher {
52
52
  _subscribe() {
53
53
  let isDone = false;
54
54
  this._context.signal?.addEventListener('abort', () => {
55
- isDone = true;
55
+ this._incrementalGraph.completedIncrementalData().return();
56
56
  });
57
57
  const _next = async () => {
58
58
  if (isDone) {
@@ -70,9 +70,6 @@ class IncrementalPublisher {
70
70
  const asyncIterator = completedIncrementalData[Symbol.asyncIterator]();
71
71
  let iteration = await asyncIterator.next();
72
72
  while (!iteration.done) {
73
- if (this._context.signal?.aborted) {
74
- throw this._context.signal.reason;
75
- }
76
73
  for (const completedResult of iteration.value) {
77
74
  this._handleCompletedIncrementalData(completedResult, context);
78
75
  }
@@ -99,6 +96,9 @@ class IncrementalPublisher {
99
96
  }
100
97
  iteration = await asyncIterator.next();
101
98
  }
99
+ if (this._context.signal?.aborted) {
100
+ throw this._context.signal.reason;
101
+ }
102
102
  await this._returnAsyncIteratorsIgnoringErrors();
103
103
  return { value: undefined, done: true };
104
104
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor",
3
- "version": "2.0.0-alpha-20240606144658-8963c8b8f661638eaee0e101a55f3b6e46cc03ff",
3
+ "version": "2.0.0-alpha-20240606224953-6d3be8381f7a6b24f2793457d1f05f89f1ae953a",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
7
7
  },
8
8
  "dependencies": {
9
- "@graphql-tools/utils": "10.3.0-alpha-20240606144658-8963c8b8f661638eaee0e101a55f3b6e46cc03ff",
9
+ "@graphql-tools/utils": "10.3.0-alpha-20240606224953-6d3be8381f7a6b24f2793457d1f05f89f1ae953a",
10
10
  "@graphql-typed-document-node/core": "3.2.0",
11
11
  "@repeaterjs/repeater": "^3.0.4",
12
12
  "tslib": "^2.4.0",