graphql-lambda-subscriptions
- APIGatewayWebSocketEvent
- APIGatewayWebSocketRequestContext
- ApiGatewayManagementApiSubset
- PubSubEvent
- ServerArgs
- StateFunctionInput
- SubscribeOptions
- SubscribePseudoIterable
- SubscriptionServer
Ƭ LoggerFunction: (message
: string
, obj
: Record
<string
, any
>) => void
▸ (message
, obj
): void
Log operational events with a logger of your choice. It will get a message and usually object with relevant data
Name | Type |
---|---|
message |
string |
obj |
Record <string , any > |
void
Ƭ MaybePromise<T
>: T
| Promise
<T
>
Name |
---|
T |
Ƭ SubscribeArgs<TRoot
, TArgs
, TContext
>: [root: TRoot, args: TArgs, context: TContext, info: GraphQLResolveInfo]
Name | Type |
---|---|
TRoot |
unknown |
TArgs |
Record <string , any > |
TContext |
unknown |
Ƭ SubscriptionFilter<TSubscribeArgs
, TReturn
>: Partial
<TReturn
> | void
| (...args
: TSubscribeArgs
) => MaybePromise
<Partial
<TReturn
> | void
>
Name | Type |
---|---|
TSubscribeArgs |
extends SubscribeArgs = SubscribeArgs |
TReturn |
extends Record <string , any > = Record <string , any > |
Ƭ WebSocketResponse: Object
Name | Type |
---|---|
body |
string |
headers? |
Record <string , string > |
statusCode |
number |
▸ makeServer(opts
): SubscriptionServer
Name | Type |
---|---|
opts |
ServerArgs |
▸ subscribe<T
, TRoot
, TArgs
, TContext
>(topic
, options?
): SubscribePseudoIterable
<T
, SubscribeArgs
<TRoot
, TArgs
, TContext
>>
Creates subscribe handler for use in your graphql schema.
subscribe
is the most important method in the library. It is the primary difference between graphql-ws
and graphql-lambda-subscriptions
. It returns a SubscribePseudoIterable that pretends to be an async iterator that you put on the subscribe
resolver for your Subscription. In reality it includes a few properties that we use to subscribe to events and fire lifecycle functions. See SubscribeOptions for information about the callbacks.
Name | Type |
---|---|
T |
extends PubSubEvent |
TRoot |
extends unknown = any |
TArgs |
extends Record <string , any > = any |
TContext |
extends unknown = any |
Name | Type | Description |
---|---|---|
topic |
T ["topic" ] |
Subscriptions are made to a string topic and can be filtered based upon the topics payload. |
options |
SubscribeOptions <T , SubscribeArgs <TRoot , TArgs , TContext >> |
Optional callbacks for filtering, and lifecycle events. |
SubscribePseudoIterable
<T
, SubscribeArgs
<TRoot
, TArgs
, TContext
>>