You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeGraphQL builds the schema correctly, but class-transformer does not validate the nested input. I also tried to add the @ValidateNested decorator, but i get the following error:
"constraints": {
"nestedValidation": "nested property customer must be either object or array"
}
Error: Argument Validation Error,
at Object.<anonymous> (/Users/iago/Drive/Code/api/node_modules/type-graphql/resolvers/validate-arg.js:21:19),
at Generator.throw (<anonymous>),
at rejected (/Users/iago/Drive/Code/api/node_modules/tslib/tslib.js:105:69),
at process.internalTickCallback (internal/process/next_tick.js:77:7)
I found a test case which contains a nested input type, but i didn't find any test case using validations.
As mentioned in this comment, it looks like the nested object is not converted to AuthorInput class, the property author is [Object: null prototype].
So, with the current limitations, is there any way to implement a nested validation?
Are you able to make a PR that fix this?
I don't think so, but i can add some test cases to ensure this is properly covered.
Additional context
TypeGraphQL Version: 0.15.0
Node Version: v11.1.0
The text was updated successfully, but these errors were encountered:
As a temporary workaround you need to perform the validation manually in resolvers, I think that class-transformer-validator would be the best (one-liner).
Describe the issue
Hello! 👋
I'm trying to validated
InputType
. A specific field has it's own type. It looks like below:The
CustomerInput
looks like this:TypeGraphQL builds the schema correctly, but
class-transformer
does not validate the nested input. I also tried to add the@ValidateNested
decorator, but i get the following error:I found a test case which contains a nested input type, but i didn't find any test case using validations.
As mentioned in this comment, it looks like the nested object is not converted to
AuthorInput
class, the propertyauthor
is[Object: null prototype]
.So, with the current limitations, is there any way to implement a nested validation?
Are you able to make a PR that fix this?
I don't think so, but i can add some test cases to ensure this is properly covered.
Additional context
The text was updated successfully, but these errors were encountered: