Documentation
Modules
common

Module: common

Interfaces

Common

StreamData

Ƭ StreamData<E>: E extends "next" ? ExecutionResult | ExecutionPatchResult : E extends "complete" ? null : never

Type parameters

NameType
Eextends StreamEvent

Defined in

src/common.ts:107


StreamDataForID

Ƭ StreamDataForID<E>: E extends "next" ? { id: string ; payload: ExecutionResult | ExecutionPatchResult } : E extends "complete" ? { id: string } : never

Type parameters

NameType
Eextends StreamEvent

Defined in

src/common.ts:114


StreamEvent

Ƭ StreamEvent: "next" | "complete"

Defined in

src/common.ts:59


TOKEN_HEADER_KEY

Const TOKEN_HEADER_KEY: "x-graphql-event-stream-token"

Header key through which the event stream token is transmitted when using the client in “single connection mode”.

Read more: https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL#single-connection-mode

Defined in

src/common.ts:18


TOKEN_QUERY_KEY

Const TOKEN_QUERY_KEY: "token"

URL query parameter key through which the event stream token is transmitted when using the client in “single connection mode”.

Read more: https://github.com/enisdenjo/graphql-sse/blob/master/PROTOCOL#single-connection-mode

Defined in

src/common.ts:28


isAsyncGenerator

isAsyncGenerator<T>(val): val is AsyncGenerator<T, any, unknown>

Checks whether the provided value is an async generator.

Type parameters

Name
T

Parameters

NameType
valunknown

Returns

val is AsyncGenerator<T, any, unknown>

Defined in

src/common.ts:169


isAsyncIterable

isAsyncIterable<T>(val): val is AsyncIterable<T>

Checks whether the provided value is an async iterable.

Type parameters

Name
T

Parameters

NameType
valunknown

Returns

val is AsyncIterable<T>

Defined in

src/common.ts:160


parseStreamData

parseStreamData<ForID, E>(e, data): ForID extends true ? StreamDataForID<E> : StreamData<E>

Type parameters

NameType
ForIDextends boolean
Eextends StreamEvent

Parameters

NameType
eE
datastring

Returns

ForID extends true ? StreamDataForID<E> : StreamData<E>

Defined in

src/common.ts:121


print

print<ForID, E>(msg): string

Type parameters

NameType
ForIDextends boolean
Eextends StreamEvent

Parameters

NameType
msgStreamMessage<ForID, E>

Returns

string

Defined in

src/common.ts:70


validateStreamEvent

validateStreamEvent(e): StreamEvent

Parameters

NameType
eunknown

Returns

StreamEvent

Defined in

src/common.ts:62