Function: subscription()

subscription<TOutput, TInput, TValue>(output, subscribeOrOptions): Subscription<SchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TInput>, TValue>

Type Parameters

TOutput extends GraphQLSilk<any, any> | ZodType<any, ZodTypeDef, any>

TInput extends InputSchema<GraphQLSilk<any, any> | ZodType<any, ZodTypeDef, any>> = undefined

TValue = "~standard" extends keyof TOutput ? "types" extends keyof NonNullable<TOutput[keyof TOutput & "~standard"]> ? "output" extends keyof NonNullable<NonNullable<TOutput[keyof ... & "~standard"]>[keyof NonNullable<...[...]> & "types"]> ? NonNullable<NonNullable<TOutput[keyof ... & "~standard"]>[keyof NonNullable<...[...]> & "types"]>[keyof NonNullable<NonNullable<...[...]>[keyof ... & "types"]> & "output"] : never : never : never | "_output" extends keyof TOutput ? TOutput[keyof TOutput & "_output"] : never

Parameters

output: TOutput

subscribeOrOptions: SubscriptionOptions<GraphQLSilkIO | ZodSchemaIO, TOutput, TInput, TValue> | () => MayPromise<AsyncIterator<"~standard" extends keyof TOutput ? "types" extends keyof NonNullable<TOutput[... & ...]> ? "output" extends keyof NonNullable<...[...]> ? NonNullable<...[...]>[keyof ... & "output"] : never : never : never | "_output" extends keyof TOutput ? TOutput[keyof TOutput & "_output"] : never, any, undefined>>

Returns

Subscription<SchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TOutput>, InputSchemaToSilk<GraphQLSilkIO | ZodSchemaIO, TInput>, TValue>

Defined in

packages/zod/src/index.ts:465