hasura_connect
hasura_connect copied to clipboard
HasuraError extensions error messages
Hi, cannot get Hasura error extensions. Hasura response is as follow:
{
"data": null,
"errors": [
{
"extensions": {
"classification": "DataFetchingException",
"errorCode": 422,
"errorMessages": [
{
"attribute": "E",
"message": "Error message",
"parameters": "{\"parameter\":20}"
}
]
},
"locations": [
{
"column": 34,
"line": 1
}
],
"message": "System error",
"path": [
"SomePath"
]
}
]
}
and calling it as follow:
try {
var result = await HasuraConnect(url, headers: headers)
.mutation(document);
return result;
}
on HasuraRequestError catch(e) {
print(e.extensions?.code);
}
But always get null. Only what I got is "System error" message. Is there way how to get to extension error messages? Thank you