Skip to content

Commit

Permalink
docs(inputs): add info about validating nested inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalLytek committed Nov 19, 2019
1 parent a56048d commit 430918d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- add basic support for directives with `@Directive()` decorator (#369)
### Fixes
- refactor union types function syntax handling to prevent possible errors with circular refs
- fix transforming and validating nested inputs and arrays (#462)

## v0.17.5
### Features
Expand Down
2 changes: 2 additions & 0 deletions docs/validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ Note that by default, the `skipMissingProperties` setting of the `class-validato

GraphQL will also check whether the fields have correct types (String, Int, Float, Boolean, etc.) so we don't have to use the `@IsOptional`, `@Allow`, `@IsString` or the `@IsInt` decorators at all!

However, when using nested input or arrays, we always have to use [`@ValidateNested()` decorator](https://github.com/typestack/class-validator#validating-nested-objects) or [`{ each: true }` option](https://github.com/typestack/class-validator#validating-arrays) to make nested validation work properly.

## Response to the Client

When a client sends incorrect data to the server:
Expand Down

0 comments on commit 430918d

Please sign in to comment.