@graphql-tools/executor-graphql-ws
Advanced tools
Comparing version 2.0.0 to 2.0.1-alpha-2ca260f847dfb52877d8a5293370a07035490661
# @graphql-tools/executor-graphql-ws | ||
## 2.0.1-alpha-2ca260f847dfb52877d8a5293370a07035490661 | ||
### Patch Changes | ||
- [#591](https://github.com/graphql-hive/gateway/pull/591) [`7474f33`](https://github.com/graphql-hive/gateway/commit/7474f339ff952c04c1f6023212691ad38bca04c5) Thanks [@ardatan](https://github.com/ardatan)! - Fix the regression preventing users from passing custom `lazy` and `lazyCloseTimeout` options | ||
## 2.0.0 | ||
@@ -4,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.0", | ||
"version": "2.0.1-alpha-2ca260f847dfb52877d8a5293370a07035490661", | ||
"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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
27883
205
2