Open morkers opened 8 months ago
There seems to be an issue validating array of input-objects.
Having a simple mutation:
Mutation: type: object config: fields: testMutation: type: Boolean resolve: "@=mutation('testMutation', [args])" args: fields: type: '[TestInput]' validation: cascade TestInput: type: input-object config: fields: subField: type: SubTestInput validation: cascade SubTestInput: type: input-object config: fields: price: type: Float validation: - Positive: ~
Then sending mutation i don't get the error i expect. The first SubTestInput is not validated.
SubTestInput
mutation{ testMutation(fields: [ { subField: { price: -1 } }, { } ]) }
As the second/last TestInput does not have SubTestInput defined, validation metadata is overriden with metadata that doesn't have any constraints registered and validation for first SubTestInput is not done.
TestInput
I'm not familiar with the validator component. Maybe @murtukov can look into it?
There seems to be an issue validating array of input-objects.
Having a simple mutation:
Then sending mutation i don't get the error i expect. The first
SubTestInput
is not validated.As the second/last
TestInput
does not haveSubTestInput
defined, validation metadata is overriden with metadata that doesn't have any constraints registered and validation for firstSubTestInput
is not done.