Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing subcribe when rebuildOutput, solve subcription megreSchema problem #1141

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/definitions/definitionBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -353,6 +354,8 @@ export type FieldOutConfig<TypeName extends string, FieldName extends string> =
resolve: FieldResolver<TypeName, FieldName>
}
: NexusOutputFieldConfig<TypeName, FieldName>
&
IsSubscriptionType<TypeName> extends true ? SubscriptionTypeConfigBase<FieldName> : {}

// prettier-ignore
export type FieldOutConfigWithName<TypeName extends string, FieldName extends string> =
Expand All @@ -361,6 +364,8 @@ export type FieldOutConfigWithName<TypeName extends string, FieldName extends st
resolve: FieldResolver<TypeName, FieldName>
}
: NexusOutputFieldConfigWithName<TypeName, FieldName>
&
IsSubscriptionType<TypeName> extends true ? SubscriptionTypeConfigBase<FieldName> : {}

export interface OutputDefinitionBuilder {
typeName: string
Expand Down
1 change: 1 addition & 0 deletions src/rebuildType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down