Interface: SubscriptionFactory()<TSchemaIO>

Function to create a GraphQL subscription.

Type Parameters

TSchemaIO extends AbstractSchemaIO

SubscriptionFactory<TOutput, TInput, TValue>(output, subscribeOrOptions): Subscription<SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, TValue>

Function to create a GraphQL subscription.

Type Parameters

TOutput extends object

TInput extends undefined | object | Record<string, TSchemaIO[0]> = undefined

TValue = InferPropertyType<TOutput, TSchemaIO[2]>

Parameters

output: TOutput

subscribeOrOptions: SubscriptionOptions<TSchemaIO, TOutput, TInput, TValue> | () => MayPromise<AsyncIterator<InferPropertyType<TOutput, TSchemaIO[2]>, any, undefined>>

Returns

Subscription<SchemaToSilk<TSchemaIO, TOutput>, InputSchemaToSilk<TSchemaIO, TInput>, TValue>

Defined in

packages/core/src/resolver/types.ts:305