I am using Appsync for graphql server. and use `$util.error(String, String, Object, Object)
in the response mapping template to response error to clients. However, the error messages clients get looks like below json. There are too many extra information there. What clients really care about is the message
I made this error. How can I response a simple json object like
{"errorMessage": "I made this error"}` to clients?
{
"data": {
"getError": null
},
"errors": [
{
"path": [
"getError"
],
"data": null,
"errorType": "ALWAYS_ERROR",
"errorInfo": null,
"locations": [
{
"line": 2,
"column": 3,
"sourceName": null
}
],
"message": "I made this error"
}
]
}