Class GraphQLClientWebSocket
Constructors
Properties
Methods
close
- close(code, reason): void
Parameters
- code: number
- reason: string
Returns void
closeByError
- closeByError(err): void
Parameters
- err: Error & {
code?: number;
}
Returns void
handleCloseEvent
- handleCloseEvent(event): Promise<void>
Returns Promise<void>
handleCompleteMessage
- handleCompleteMessage(message): void
Returns void
handleConnectionAckMessage
- handleConnectionAckMessage(message): void
Returns void
handleErrorEvent
- handleErrorEvent(event): Promise<void>
Returns Promise<void>
handleErrorMessage
- handleErrorMessage(message): void
Returns void
handleMessageEvent
- handleMessageEvent(event): Promise<void>
Returns Promise<void>
handleNextMessage
- handleNextMessage(message): void
Returns void
init
- init(connectionInitPayload?): GraphQLClientWebSocket
Parameters
Optional
connectionInitPayload: Record<string, unknown>
isOpen
- isOpen(): boolean
Returns boolean
isOpenOrConnecting
- isOpenOrConnecting(): boolean
Returns boolean
makeClosingError
- makeClosingError(code, reason): Error & {
code: number;
} Parameters
- code: number
- reason: string
Returns Error & {
code: number;
}
parseCompleteMessage
- parseCompleteMessage(message): CompleteMessage
Parameters
- message: Record<string, unknown>
parseConnectionAckMessage
parseErrorMessage
- parseErrorMessage(message): ErrorMessage
Parameters
- message: Record<string, unknown>
parseNextMessage
- parseNextMessage(message): NextMessage
Parameters
- message: Record<string, unknown>
requireAck
- requireAck(): Promise<undefined | Record<string, unknown>>
Returns Promise<undefined | Record<string, unknown>>
send
- send(message): void
Returns void
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>