Show errors when HTTP code is not 2xx
andikhadev opened this issue · comments
andikhadev commented
Perceived Problem
I have a problem to display error messages in graphql such as query not found, one field not found, etc. the problem is that I don't get data errors in the response if the status code is not 2xx
like 4xx
or in a fetch that is not ok in the response. I only get the status code and a message that is not good to display to the user.
Ideas / Proposed Solution(s)
When fetch response is not ok/ 4xx, return the client error with errors
property that can be obtained by a response that has been parsed in JSON.
Jason Kuhrt commented
This will be solved by #921. Not sure it works in your case, but, you could also consider putting known errors into the schema.