@graphql-tools/executor-graphql-ws 1.3.5 → 1.3.6-alpha-8299bc391369a32bcc87fafa8ef50fad0e18c79c

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @graphql-tools/executor-graphql-ws
2
2
 
3
+ ## 1.3.6-alpha-8299bc391369a32bcc87fafa8ef50fad0e18c79c
4
+
5
+ ### Patch Changes
6
+
7
+ - [#373](https://github.com/graphql-hive/gateway/pull/373) [`e257b4a`](https://github.com/graphql-hive/gateway/commit/e257b4a50f536ce0c94147453ec05f9aa82e181f) Thanks [@ardatan](https://github.com/ardatan)! - dependencies updates:
8
+
9
+ - Updated dependency [`@graphql-tools/utils@^10.7.0` ↗︎](https://www.npmjs.com/package/@graphql-tools/utils/v/10.7.0) (from `^10.6.2`, in `dependencies`)
10
+
3
11
  ## 1.3.5
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -50,7 +50,9 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
50
50
  variables,
51
51
  operationName,
52
52
  extensions,
53
- operationType = utils.getOperationASTFromRequest(executionRequest).operation
53
+ operationType = utils.getOperationASTFromRequest(executionRequest).operation,
54
+ info,
55
+ signal = info?.signal
54
56
  } = executionRequest;
55
57
  if (extensions?.["connectionParams"] && typeof extensions?.["connectionParams"] === "object") {
56
58
  executorConnectionParams = Object.assign(
@@ -65,6 +67,11 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
65
67
  operationName,
66
68
  extensions
67
69
  });
70
+ if (iterableIterator.return && signal) {
71
+ utils.registerAbortSignalListener(signal, () => {
72
+ iterableIterator.return?.();
73
+ });
74
+ }
68
75
  if (operationType === "subscription") {
69
76
  return iterableIterator;
70
77
  }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { memoize1, getOperationASTFromRequest } from '@graphql-tools/utils';
1
+ import { memoize1, getOperationASTFromRequest, registerAbortSignalListener } from '@graphql-tools/utils';
2
2
  import { DisposableSymbols } from '@whatwg-node/disposablestack';
3
3
  import { print } from 'graphql';
4
4
  import { createClient } from 'graphql-ws';
@@ -44,7 +44,9 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
44
44
  variables,
45
45
  operationName,
46
46
  extensions,
47
- operationType = getOperationASTFromRequest(executionRequest).operation
47
+ operationType = getOperationASTFromRequest(executionRequest).operation,
48
+ info,
49
+ signal = info?.signal
48
50
  } = executionRequest;
49
51
  if (extensions?.["connectionParams"] && typeof extensions?.["connectionParams"] === "object") {
50
52
  executorConnectionParams = Object.assign(
@@ -59,6 +61,11 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
59
61
  operationName,
60
62
  extensions
61
63
  });
64
+ if (iterableIterator.return && signal) {
65
+ registerAbortSignalListener(signal, () => {
66
+ iterableIterator.return?.();
67
+ });
68
+ }
62
69
  if (operationType === "subscription") {
63
70
  return iterableIterator;
64
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor-graphql-ws",
3
- "version": "1.3.5",
3
+ "version": "1.3.6-alpha-8299bc391369a32bcc87fafa8ef50fad0e18c79c",
4
4
  "type": "module",
5
5
  "description": "A set of utils for faster development of GraphQL tools",
6
6
  "repository": {
@@ -39,7 +39,7 @@
39
39
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
40
40
  },
41
41
  "dependencies": {
42
- "@graphql-tools/utils": "^10.6.2",
42
+ "@graphql-tools/utils": "^10.7.0",
43
43
  "@whatwg-node/disposablestack": "^0.0.5",
44
44
  "graphql-ws": "^5.14.0",
45
45
  "isomorphic-ws": "^5.0.0",
@@ -49,7 +49,7 @@
49
49
  "devDependencies": {
50
50
  "@types/ws": "^8.0.0",
51
51
  "graphql": "^16.9.0",
52
- "pkgroll": "2.5.1"
52
+ "pkgroll": "2.6.0"
53
53
  },
54
54
  "sideEffects": false
55
55
  }