Skip to content

Errors don't clearly distinguish between a genuine GraphQL error and a network error #35

@rhigman

Description

@rhigman

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions