Module: client
Classes
Interfaces
Client
createClient
▸ createClient<SingleConnection
>(options
): Client
<SingleConnection
>
Creates a disposable GraphQL over SSE client to transmit GraphQL operation results.
If you have an HTTP/2 server, it is recommended to use the client
in “distinct connections mode” (singleConnection = false
) which will
create a new SSE connection for each subscribe. This is the default.
However, when dealing with HTTP/1 servers from a browser, consider using
the “single connection mode” (singleConnection = true
) which will
use only one SSE connection.
Type parameters
Name | Type |
---|---|
SingleConnection | extends boolean = false |
Parameters
Name | Type |
---|---|
options | ClientOptions <SingleConnection > |
Returns
Client
<SingleConnection
>
Defined in
Other
ExecutionPatchResult
Re-exports ExecutionPatchResult
ExecutionResult
Re-exports ExecutionResult
RequestParams
Re-exports RequestParams
Sink
Re-exports Sink
StreamData
Re-exports StreamData
StreamDataForID
Re-exports StreamDataForID
StreamEvent
Re-exports StreamEvent
StreamMessage
Re-exports StreamMessage
TOKEN_HEADER_KEY
Re-exports TOKEN_HEADER_KEY
TOKEN_QUERY_KEY
Re-exports TOKEN_QUERY_KEY
isAsyncGenerator
Re-exports isAsyncGenerator
isAsyncIterable
Re-exports isAsyncIterable
parseStreamData
Re-exports parseStreamData
Re-exports print
validateStreamEvent
Re-exports validateStreamEvent