diff --git a/packages/graphql/lib/interfaces/gql-module-options.interface.ts b/packages/graphql/lib/interfaces/gql-module-options.interface.ts index 8f1991d63..1c9c712e1 100644 --- a/packages/graphql/lib/interfaces/gql-module-options.interface.ts +++ b/packages/graphql/lib/interfaces/gql-module-options.interface.ts @@ -120,6 +120,20 @@ export interface GqlModuleOptions { * Extra static metadata to be loaded into the specification */ metadata?: () => Promise>; + + /** + * If `true`, enables development mode helpers and logs messages of all severity levels + * If `false`, only warn- and error-level messages are logged. + * @default true + */ + debug?: boolean; + + /** + * If `true`, enables schema introspection by clients. Default is `true` unless `NODE_ENV` is + * set to `production` + * @default true + */ + introspection?: boolean; } export interface GqlOptionsFactory< diff --git a/packages/graphql/lib/schema-builder/metadata/union.metadata.ts b/packages/graphql/lib/schema-builder/metadata/union.metadata.ts index 683b5ccc4..4211481d9 100644 --- a/packages/graphql/lib/schema-builder/metadata/union.metadata.ts +++ b/packages/graphql/lib/schema-builder/metadata/union.metadata.ts @@ -1,7 +1,9 @@ import { Type } from '@nestjs/common'; import { ResolveTypeFn } from '../../interfaces'; -export interface UnionMetadata[] = readonly Type[]> { +export interface UnionMetadata< + T extends readonly Type[] = readonly Type[], +> { name: string; typesFn: () => T; id?: symbol; diff --git a/packages/graphql/lib/type-factories/create-union-type.factory.ts b/packages/graphql/lib/type-factories/create-union-type.factory.ts index 38f67691b..ddacb5d82 100644 --- a/packages/graphql/lib/type-factories/create-union-type.factory.ts +++ b/packages/graphql/lib/type-factories/create-union-type.factory.ts @@ -13,7 +13,9 @@ import { TypeMetadataStorage } from '../schema-builder/storages/type-metadata.st /** * Interface defining options that can be passed to `createUnionType` function. */ -export interface UnionOptions[] = Type[]> { +export interface UnionOptions< + T extends readonly Type[] = Type[], +> { /** * Name of the union. */ @@ -40,9 +42,9 @@ export type Union = InstanceType>; * Creates a GraphQL union type composed of types references. * @param options */ -export function createUnionType[] = Type[]>( - options: UnionOptions, -): Union { +export function createUnionType< + T extends readonly Type[] = Type[], +>(options: UnionOptions): Union { const { name, description, types, resolveType } = options; const id = Symbol(name);