diff --git a/src/definitions/definitionBlocks.ts b/src/definitions/definitionBlocks.ts index 6b3e490f..77b1021d 100644 --- a/src/definitions/definitionBlocks.ts +++ b/src/definitions/definitionBlocks.ts @@ -13,6 +13,7 @@ import type { Directives } from './directive' import type { NexusMetaType } from './nexusMeta' import type { AllNexusInputTypeDefs, AllNexusOutputTypeDefs, NexusWrapKind } from './wrapping' import type { BaseScalars, Maybe } from './_types' +import type { IsSubscriptionType, SubscriptionTypeConfigBase } from './subscriptionType' export interface CommonFieldConfig { /** The description to annotate the GraphQL SDL */ @@ -353,6 +354,8 @@ export type FieldOutConfig = resolve: FieldResolver } : NexusOutputFieldConfig + & + IsSubscriptionType extends true ? SubscriptionTypeConfigBase : {} // prettier-ignore export type FieldOutConfigWithName = @@ -361,6 +364,8 @@ export type FieldOutConfigWithName } : NexusOutputFieldConfigWithName + & + IsSubscriptionType extends true ? SubscriptionTypeConfigBase : {} export interface OutputDefinitionBuilder { typeName: string diff --git a/src/rebuildType.ts b/src/rebuildType.ts index cf986f7b..9faf2f6b 100644 --- a/src/rebuildType.ts +++ b/src/rebuildType.ts @@ -178,6 +178,7 @@ export function rebuildOutputDefinition( description: fieldConfig.description, deprecation: fieldConfig.deprecationReason, extensions: fieldConfig.extensions, + subscribe: fieldConfig.subscribe, args: rebuildArgs(typeName, fieldName, fieldConfig.args ?? {}, config), resolve: fieldConfig.resolve, })