Use nest-cli.jsoncompilerOptions.builder.swc:truecompilerOptions.typeCheck:true
Import metadata.ts file in GraphQLModule config
Use a composition of GraphQL Mapped Types to a class with @InputType() decorator
@InputType()
export class UpdateInput extends PartialType(
// PickType(CreateInput, ['description'] as const),
// or any other mapped type like:
OmitType(CreateInput, ['omitUpdateProperty'] as const),
) {
@IsNumber()
id: number;
}
The generated schema (code first aproach) generate the type for the input without the properties from CreateInput class
Is there an existing issue for this?
Current behavior
nest-cli.json
compilerOptions.builder.swc:true
compilerOptions.typeCheck:true
metadata.ts
file inGraphQLModule
config@InputType()
decoratorCreateInput
classinput UpdateInput { id: Float! }
Package
Other package
@nestjs/cli @nestjs/graphql @swc/cli
NestJS version
^10.0.0
Packages versions
Node.js version
20.17.0
In which operating systems have you tested?
Other
No response