Module: common
Interfaces
Common
StreamData
Ƭ StreamData<E
>: E
extends "next"
? ExecutionResult
| ExecutionPatchResult
: E
extends "complete"
? null
: never
Type parameters
Name | Type |
---|---|
E | extends StreamEvent |
Defined in
StreamDataForID
Ƭ StreamDataForID<E
>: E
extends "next"
? { id
: string
; payload
: ExecutionResult
| ExecutionPatchResult
} : E
extends "complete"
? { id
: string
} : never
Type parameters
Name | Type |
---|---|
E | extends StreamEvent |
Defined in
StreamEvent
Ƭ StreamEvent: "next"
| "complete"
Defined in
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
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
isAsyncGenerator
▸ isAsyncGenerator<T
>(val
): val is AsyncGenerator<T, any, unknown>
Checks whether the provided value is an async generator.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is AsyncGenerator<T, any, unknown>
Defined in
isAsyncIterable
▸ isAsyncIterable<T
>(val
): val is AsyncIterable<T>
Checks whether the provided value is an async iterable.
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
val | unknown |
Returns
val is AsyncIterable<T>
Defined in
parseStreamData
▸ parseStreamData<ForID
, E
>(e
, data
): ForID
extends true
? StreamDataForID
<E
> : StreamData
<E
>
Type parameters
Name | Type |
---|---|
ForID | extends boolean |
E | extends StreamEvent |
Parameters
Name | Type |
---|---|
e | E |
data | string |
Returns
ForID
extends true
? StreamDataForID
<E
> : StreamData
<E
>
Defined in
▸ print<ForID
, E
>(msg
): string
Type parameters
Name | Type |
---|---|
ForID | extends boolean |
E | extends StreamEvent |
Parameters
Name | Type |
---|---|
msg | StreamMessage <ForID , E > |
Returns
string
Defined in
validateStreamEvent
▸ validateStreamEvent(e
): StreamEvent
Parameters
Name | Type |
---|---|
e | unknown |