Closed chshersh closed 3 years ago
Currently, when something is wrong, it's hard to understand why. I propose to add a custom data type and return it as an error.
The data type will contain:
When you provide an invalid query like this:
query { repository(owner: "kowainik", "github-graphql") { issue(number: 5) { bodies } } }
GitHub API returns the following message:
{ "errors": [ { "message": "Parse error on \"github-graphql\" (STRING) at [2, 33]", "locations": [ { "line": 2, "column": 33 } ] } ] }
Ideally, this shouldn't happen in users' code (because we provide type-safe API), but this still can happen due to errors in our library, so it's good to provide more info here.
Currently, when something is wrong, it's hard to understand why. I propose to add a custom data type and return it as an error.
The data type will contain:
When you provide an invalid query like this:
GitHub API returns the following message:
Ideally, this shouldn't happen in users' code (because we provide type-safe API), but this still can happen due to errors in our library, so it's good to provide more info here.