Skip to content

Commit 3a75b00

Browse files
author
Marek Urbanowicz
committed
Add missing isOptional on optional field in Sample-23
1 parent 00ddc0a commit 3a75b00

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

sample/23-type-graphql/src/recipes/dto/new-recipe.input.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Length, MaxLength } from 'class-validator';
1+
import { IsOptional, Length, MaxLength } from 'class-validator';
22
import { Field, InputType } from 'type-graphql';
33

44
@InputType()
@@ -8,6 +8,7 @@ export class NewRecipeInput {
88
title: string;
99

1010
@Field({ nullable: true })
11+
@IsOptional()
1112
@Length(30, 255)
1213
description?: string;
1314

0 commit comments

Comments
 (0)