You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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()exportclassUpdateInputextendsPartialType(// PickType(CreateInput, ['description'] as const),// or any other mapped type like:OmitType(CreateInput,['omitUpdateProperty']asconst),){
@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
classcompilerOptions.builder.tsc:true
works fineMinimum reproduction code
https://github.com/pedroaraujo1952/nestjs-gql-mapped-types-error
Steps to reproduce
npm ci
npm run start:dev
ornpm run start
Expected behavior
Expected generated
schema.gql
:Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
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
The text was updated successfully, but these errors were encountered: