@graphql-tools/executor-graphql-ws 1.1.0 → 1.1.1-alpha-20231029232138-3c49dcd6

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/cjs/index.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildGraphQLWSExecutor = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const utils_1 = require("@graphql-tools/utils");
6
5
  const graphql_1 = require("graphql");
7
6
  const graphql_ws_1 = require("graphql-ws");
8
7
  const isomorphic_ws_1 = tslib_1.__importDefault(require("isomorphic-ws"));
8
+ const utils_1 = require("@graphql-tools/utils");
9
9
  function isClient(client) {
10
10
  return 'subscribe' in client;
11
11
  }
@@ -17,6 +17,7 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
17
17
  }
18
18
  else {
19
19
  graphqlWSClient = (0, graphql_ws_1.createClient)({
20
+ ...clientOptionsOrClient,
20
21
  webSocketImpl: isomorphic_ws_1.default,
21
22
  lazy: true,
22
23
  connectionParams: () => {
@@ -25,7 +26,6 @@ function buildGraphQLWSExecutor(clientOptionsOrClient) {
25
26
  : clientOptionsOrClient.connectionParams) || {};
26
27
  return Object.assign(optionsConnectionParams, executorConnectionParams);
27
28
  },
28
- ...clientOptionsOrClient,
29
29
  });
30
30
  if (clientOptionsOrClient.onClient) {
31
31
  clientOptionsOrClient.onClient(graphqlWSClient);
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { getOperationASTFromRequest } from '@graphql-tools/utils';
2
1
  import { print } from 'graphql';
3
2
  import { createClient } from 'graphql-ws';
4
3
  import WebSocket from 'isomorphic-ws';
4
+ import { getOperationASTFromRequest, } from '@graphql-tools/utils';
5
5
  function isClient(client) {
6
6
  return 'subscribe' in client;
7
7
  }
@@ -13,6 +13,7 @@ export function buildGraphQLWSExecutor(clientOptionsOrClient) {
13
13
  }
14
14
  else {
15
15
  graphqlWSClient = createClient({
16
+ ...clientOptionsOrClient,
16
17
  webSocketImpl: WebSocket,
17
18
  lazy: true,
18
19
  connectionParams: () => {
@@ -21,7 +22,6 @@ export function buildGraphQLWSExecutor(clientOptionsOrClient) {
21
22
  : clientOptionsOrClient.connectionParams) || {};
22
23
  return Object.assign(optionsConnectionParams, executorConnectionParams);
23
24
  },
24
- ...clientOptionsOrClient,
25
25
  });
26
26
  if (clientOptionsOrClient.onClient) {
27
27
  clientOptionsOrClient.onClient(graphqlWSClient);
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@graphql-tools/executor-graphql-ws",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-alpha-20231029232138-3c49dcd6",
4
4
  "description": "A set of utils for faster development of GraphQL tools",
5
5
  "sideEffects": false,
6
6
  "peerDependencies": {
7
7
  "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@types/ws": "^8.0.0",
11
- "ws": "^8.13.0",
12
- "isomorphic-ws": "^5.0.0",
13
10
  "@graphql-tools/utils": "^10.0.2",
11
+ "@types/ws": "^8.0.0",
14
12
  "graphql-ws": "^5.14.0",
15
- "tslib": "^2.4.0"
13
+ "isomorphic-ws": "^5.0.0",
14
+ "tslib": "^2.4.0",
15
+ "ws": "^8.13.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
@@ -1,5 +1,5 @@
1
- import { Executor } from '@graphql-tools/utils';
2
1
  import { Client, ClientOptions } from 'graphql-ws';
2
+ import { Executor } from '@graphql-tools/utils';
3
3
  interface GraphQLWSExecutorOptions extends ClientOptions {
4
4
  onClient?: (client: Client) => void;
5
5
  }
@@ -1,5 +1,5 @@
1
- import { Executor } from '@graphql-tools/utils';
2
1
  import { Client, ClientOptions } from 'graphql-ws';
2
+ import { Executor } from '@graphql-tools/utils';
3
3
  interface GraphQLWSExecutorOptions extends ClientOptions {
4
4
  onClient?: (client: Client) => void;
5
5
  }