@tothandras Sorry to raise the dead (#66) but do you have a working example of how to get the individual field validation errors for a mutation? The only error graphql seems to give back is "modelName validation failed". I see where mongoose is calling that error but I can't find why it's calling THAT error and not the specific one for the field. Thanks for any help.
Reproduce the Error
GraphQL POST:
// my variables
{
"input": {
"name": ""
}
}
// my mutation
mutation addModel($input: addModelInput!) {
addModel(input: $input) {
changedDepositionEdge {
node {
_id
name
}
}
}
}
Overview of the Issue
@tothandras Sorry to raise the dead (#66) but do you have a working example of how to get the individual field validation errors for a mutation? The only error graphql seems to give back is "
modelName
validation failed". I see where mongoose is calling that error but I can't find why it's calling THAT error and not the specific one for the field. Thanks for any help.Reproduce the Error
GraphQL POST:
Returns:
Input schema(s):
Node version:
6.3.1
Graffiti-Mongoose version:5.3.0
Related Issues
66
Suggest a Fix
Does mongoose call multiple errors upon bad validation? Are we only checking for one?