nestjs graphql validator
Would you like to validate that your string is not longer than 250 characters? Or is acceptable by regex? You can...
Example usage
In your resolver
file
@@public // ... return email name @@public // ... @@public // ... @@public // ...
Email field is validated before body of createUserTest
is execuded.
In case of error BadRequestException
from import { BadRequestException } from '@nestjs/common'
the is throwed.
Supported operations
Name | Type |
---|---|
maxLen | string |
minLen | string |
min | number |
max | number |
regExp | regular expression |
rules | Array of strings |
orNull | Accept null/undefined value |
enum | Array of values |
(for rules only isEmail is avalible right now)