@graphql-tools/executor-legacy-ws
Version:
A set of utils for faster development of GraphQL tools
26 lines (25 loc) • 1.05 kB
text/typescript
import WebSocket from 'isomorphic-ws';
import { DisposableExecutor } from '@graphql-tools/utils';
export declare enum LEGACY_WS {
CONNECTION_INIT = "connection_init",
CONNECTION_ACK = "connection_ack",
CONNECTION_ERROR = "connection_error",
CONNECTION_KEEP_ALIVE = "ka",
START = "start",
STOP = "stop",
CONNECTION_TERMINATE = "connection_terminate",
DATA = "data",
ERROR = "error",
COMPLETE = "complete"
}
export interface LegacyWSExecutorOpts {
connectionParams?: Record<string, unknown> | (() => Record<string, unknown>);
headers?: Record<string, any>;
/**
* Whether to reject unauthorized TLS certificates when connecting over `wss://`.
* Defaults to `true`. Set to `false` only for trusted environments that use
* self-signed certificates (for example local development).
*/
rejectUnauthorized?: boolean;
}
export declare function buildWSLegacyExecutor(subscriptionsEndpoint: string, WebSocketImpl: typeof WebSocket, options?: LegacyWSExecutorOpts): DisposableExecutor;