Skip to content

Commit 9265743

Browse files
Merge pull request nestjs#1624 from murbanowicz/feature/add-missing-isoptional
sample(): add missing isOptional() to optional field in sample-23
2 parents 00ddc0a + 3a75b00 commit 9265743

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)