Hi,
We are testing lambdas mutation resolvers to add some business logic.
We would need to return some validation errors from the lambdas mutation resolver.
I’ve been playing adding error object to the errors JSON array, but mutation resolver is expecting the registered type .
const errors = [
{
"message": "Custom error return from lambda mutation",
"locations": [
{
"line": 5,
"column": 4
}
]
}
];
{
"errors": [
{
"message": "Non-nullable field 'id' (type ID!) was not present in result from Dgraph. GraphQL error propagation triggered.",
"locations": [
{
"line": 3,
"column": 5
}
],
"path": [
"newOrderHeader",
"id"
]
}
],
"data": null,
"extensions": {
"tracing": {
"version": 1,
"startTime": "2021-05-03T18:59:15.100679846Z",
"endTime": "2021-05-03T18:59:15.157225308Z",
"duration": 56545462
}
}
}
What would be the way to do this ? I did not find anything on the documentation.
Thanks
Regards