Skip to content

Latest commit

 

History

History
75 lines (47 loc) · 1.96 KB

server.Context.md

File metadata and controls

75 lines (47 loc) · 1.96 KB

graphql-ws / server / Context

Interface: Context<P, E>

server.Context

Type parameters

Name Type
P extends ConnectionInitMessage["payload"] = ConnectionInitMessage["payload"]
E unknown

Table of contents

Properties

Properties

acknowledged

Readonly acknowledged: boolean

Indicates that the connection was acknowledged by having dispatched the ConnectionAck message to the related client.


connectionInitReceived

Readonly connectionInitReceived: boolean

Indicates that the ConnectionInit message has been received by the server. If this is true, the client wont be kicked off after the wait timeout has passed.


connectionParams

Optional Readonly connectionParams: Readonly<P>

The parameters passed during the connection initialisation.


extra

extra: E

An extra field where you can store your own context values to pass between callbacks.


subscriptions

Readonly subscriptions: Record<string, null | AsyncGenerator<unknown, any, unknown> | AsyncIterable<unknown>>

Holds the active subscriptions for this context. All operations that are taking place are aggregated here. The user is subscribed to an operation when waiting for result(s).

If the subscription behind an ID is an AsyncIterator - the operation is streaming; on the contrary, if the subscription is null - it is simply a reservation, meaning - the operation resolves to a single result or is still pending/being prepared.