@graphql-tools/executor-graphql-ws
Advanced tools
Comparing version 2.0.1-alpha-9d206825bb802b9d4cebc55eaa8bd5e0bd4c5b16 to 2.0.1-alpha-d6fbffa3533e2ab4005a589cc73e1806eaa73756
# @graphql-tools/executor-graphql-ws | ||
## 2.0.1-alpha-9d206825bb802b9d4cebc55eaa8bd5e0bd4c5b16 | ||
## 2.0.1-alpha-d6fbffa3533e2ab4005a589cc73e1806eaa73756 | ||
### Patch Changes | ||
- [#421](https://github.com/graphql-hive/gateway/pull/421) [`53a8ac2`](https://github.com/graphql-hive/gateway/commit/53a8ac2c0a5f140f9aed6355dfa4122fefc7f884) Thanks [@renovate](https://github.com/apps/renovate)! - dependencies updates: | ||
- [#591](https://github.com/graphql-hive/gateway/pull/591) [`7d42160`](https://github.com/graphql-hive/gateway/commit/7d42160c31a10efbc680826704410fc1a33fb97c) Thanks [@ardatan](https://github.com/ardatan)! - Fix the regression preventing users from passing custom `lazy` and `lazyCloseTimeout` options | ||
- Updated dependency [`graphql-ws@^6.0.3` ↗︎](https://www.npmjs.com/package/graphql-ws/v/6.0.3) (from `^5.14.0`, in `dependencies`) | ||
## 2.0.0 | ||
@@ -12,0 +10,0 @@ |
import { DisposableAsyncExecutor } from '@graphql-tools/utils'; | ||
import { print } from 'graphql'; | ||
import { Client } from 'graphql-ws'; | ||
import { DocumentNode } from 'graphql'; | ||
import { EventErrorListener, EventMessageListener, EventConnectingListener, EventOpenedListener, EventConnectedListener, EventPingListener, EventPongListener, EventClosedListener, Client } from 'graphql-ws'; | ||
interface GraphQLWSExecutorOptions { | ||
onClient?: (client: Client) => void; | ||
print?: typeof print; | ||
print?(doc: DocumentNode): string; | ||
/** The URL of the WebSocket server to connect to. */ | ||
@@ -37,2 +36,21 @@ url: string; | ||
lazyCloseTimeout?: number; | ||
/** | ||
* Do not use this option unless you know what you are doing. | ||
* @internal | ||
*/ | ||
on?: Partial<{ | ||
error: EventErrorListener; | ||
message: EventMessageListener; | ||
connecting: EventConnectingListener; | ||
opened: EventOpenedListener; | ||
connected: EventConnectedListener; | ||
ping: EventPingListener; | ||
pong: EventPongListener; | ||
closed: EventClosedListener; | ||
}> | undefined; | ||
/** | ||
* Do not use this option unless you know what you are doing. | ||
* @internal | ||
*/ | ||
onClient?: (client: Client) => void; | ||
} | ||
@@ -39,0 +57,0 @@ declare function buildGraphQLWSExecutor(clientOptionsOrClient: GraphQLWSExecutorOptions | Client): DisposableAsyncExecutor; |
@@ -29,7 +29,9 @@ import { serializeExecutionRequest, defaultPrintFn } from '@graphql-tools/executor-common'; | ||
webSocketImpl, | ||
lazy: true, | ||
lazy: clientOptionsOrClient.lazy !== false, | ||
lazyCloseTimeout: clientOptionsOrClient.lazyCloseTimeout || 0, | ||
connectionParams: () => { | ||
const optionsConnectionParams = (typeof clientOptionsOrClient.connectionParams === "function" ? clientOptionsOrClient.connectionParams() : clientOptionsOrClient.connectionParams) || {}; | ||
return Object.assign(optionsConnectionParams, executorConnectionParams); | ||
} | ||
}, | ||
on: clientOptionsOrClient.on | ||
}); | ||
@@ -36,0 +38,0 @@ if (clientOptionsOrClient.onClient) { |
{ | ||
"name": "@graphql-tools/executor-graphql-ws", | ||
"version": "2.0.1-alpha-9d206825bb802b9d4cebc55eaa8bd5e0bd4c5b16", | ||
"version": "2.0.1-alpha-d6fbffa3533e2ab4005a589cc73e1806eaa73756", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "A set of utils for faster development of GraphQL tools", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
27883
205