Validation is called on optional fields that are not passed
joesaunderson opened this issue · 0 comments
joesaunderson commented
Q | A |
---|---|
Bug report? | yes |
Feature request? | no |
BC Break report? | no |
RFC? | no |
Version/Branch | 1 |
When validating a field like so:
...
config:
description: "An input object for editing a merchant"
fields:
name:
type: "String"
validation:
link: 'App\Entity::$name'
description:
type: "String"
And using that in a mutation like
mutation {
edit(set: {description: "Foo"}) {
id
}
}
I am getting an error for validation on the name
field, which uses the Symfony "Assert/NotBlank" rule.
"extensions": {
"validation": {
"set.name": [
{
"message": "Name must not be blank",
"code": "c1051bb4-d103-4f74-8988-acbcafc7fdc3"
}
]
}
},
Should validation be called for optional fields that are not passed in?