@graphql-tools/executor-legacy-ws
Version:
A set of utils for faster development of GraphQL tools
21 lines (20 loc) • 797 B
TypeScript
/// <reference types="ws" />
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>;
}
export declare function buildWSLegacyExecutor(subscriptionsEndpoint: string, WebSocketImpl: typeof WebSocket, options?: LegacyWSExecutorOpts): DisposableExecutor;