Class GraphQLWebSocketClient<TTypings>
Constructors
Properties
Readonly
protocol
protocol: string
Methods
close
- close(code?, reason?): void
Parameters
Optional
code: numberOptional
reason: string
Returns void
setConnectionInitPayload
- setConnectionInitPayload(connectionInitPayload): void
Parameters
- connectionInitPayload: Record<string, unknown>
Returns void
shouldRetry
- shouldRetry(err): boolean
Parameters
- err: Error & {
code?: number;
}
Returns boolean
subscribe
- subscribe<TData>(payload): AsyncPushIterator<ExecutionResult<TData, ObjMap<unknown>>>
Parameters
- payload: {
operationName?: null | string;
query: string;
variables?: null | Record<string, unknown>;
}Optional
operationName?: null | string
query: string
Optional
variables?: null | Record<string, unknown>
subscribeAsync
- subscribeAsync<TData>(payload, options): (() => void)
Parameters
- payload: {
operationName?: null | string;
query: string;
variables?: null | Record<string, unknown>;
}Optional
operationName?: null | string
query: string
Optional
variables?: null | Record<string, unknown>
- options: {
onData: ((data: TData) => unknown);
onError: ((error: Error) => unknown);
}onData: ((data: TData) => unknown)
- (data): unknown
Returns unknown
onError: ((error: Error) => unknown)
- (error): unknown
Returns unknown
Returns (() => void)
subscribeAsyncNamed
- subscribeAsyncNamed<TSubscriptionName>(operationName, variables, options): (() => void)
Type Parameters
- TSubscriptionName extends string
Returns (() => void)