SubscriptionOptions

Interface defining options that can be passed to @Subscription() decorator.


interface SubscriptionOptions extends BaseTypeOptions {
  name?: string
  description?: string
  deprecationReason?: string
  filter?: (payload: any, variables: any, context: any) => boolean | Promise<boolean>
  resolve?: (payload: any, args: any, context: any, info: any) => any | Promise<any>

  // inherited from graphql/packages/graphql/lib/BaseTypeOptions
  nullable?: boolean | NullableList
  defaultValue?: T
}

Properties

Property Description
name?: string

Name of the subscription.

description?: string

Description of the subscription.

deprecationReason?: string

Subscription deprecation reason (if deprecated).

filter?: (payload: any, variables: any, context: any) => boolean | Promise<boolean>

Filter messages function.

resolve?: (payload: any, args: any, context: any, info: any) => any | Promise<any>

Resolve messages function (to transform payload/message shape).