Errors are always returned in the following format:
GraphQL Error.
Request: [snip]
Response: [snip]
If the API being called is down (or even if the client has been misconfigured with a URL that isn't a GraphQL API at all), the only way to detect that this might be the case is that the Response: section is empty. This is difficult to spot/parse in amongst all the raw query data.
When the problem is a genuine GraphQL error, the Response: section usually contains JSON with errors and messages segments, e.g.:
{"errors":[{"message":"Unknown field \"badquery\" on type \"QueryRoot\"","locations":[{"line":3,"column":17}]}]}
It would be nice if the client could parse the response and return the error message - or raise a more specific error if these segments are not found.
Errors are always returned in the following format:
If the API being called is down (or even if the client has been misconfigured with a URL that isn't a GraphQL API at all), the only way to detect that this might be the case is that the
Response:section is empty. This is difficult to spot/parse in amongst all the raw query data.When the problem is a genuine GraphQL error, the
Response:section usually contains JSON witherrorsandmessagessegments, e.g.:It would be nice if the client could parse the response and return the error message - or raise a more specific error if these segments are not found.