enum
-
[NestJS] GraphQL Input Type Enum Field 사용 방법JavaScript/NestJS 2020. 11. 25. 11:17
enum에 registerEnumType 추가해줘야 사용 가능 @InputType() export class PracticeInputType { @IsNumber() @Field(() => Int) public id: number; @IsEnum(PracticeType) @Field(() => PracticeType) public practiceType: PracticeType; } export enum PracticeType { Test1 = 'test1', Test2 = 'test2', Test3 = 'test3', } registerEnumType(PracticeType, { name: 'PracticeType' });