Hi!
I have a custom GQL endpoint I created, it’s a mutation with the following resolver:
resolve: async (parent, args, context) => {
return await generateColloLabelResolverMutation(args, context)
.then((response) => {
return response
})
.catch((e) => {
throw new ApplicationError(e?.response?.statusText, e?.response?.data)
})
},
Now when I throw the ApplicationError, I expect a 400
for example, but my frontend receives a 200
, but with gqlErrors
populated:
{
"client": "default",
"operationType": "mutation",
"operationName": "GenerateColloLabel",
"statusCode": 200,
"gqlErrors": [
{
"message": "An application error occured",
"extensions": {
"error": {
"name": "ApplicationError",
"message": "An application error occured",
"details": {
"error": true,
"status": 400,
"message": "Template processing error. Invalid barcode type specified.",
"credits": 0,
"remainingCredits": 16043,
"duration": 989,
"errorCode": 400
}
},
"code": "STRAPI_APPLICATION_ERROR"
}
}
],
"value": true
}
Why is the statusCode
in the root error object 200
?
Any documentation on this would be great.