-
Notifications
You must be signed in to change notification settings - Fork 843
Add optional Type to FormattedError #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
What do you think @sogko, @chris-ramon? |
@maxsz I believe we have to do something like this instead: graphql/graphql-js@0b2e81c#diff-f8e4bedf89ec2148ccb1602bfc6a7ae7 |
This is how github's API exposes machine-readable error strings.
a05aae4
to
3b63e33
Compare
@christianpv looks good! I've updated the PR 👍 |
I went with a different approach in #279 and chose just to store the original error with |
Any update on this? |
Thanks a lot @maxsz! — latest spec of GraphQL details how to expose additional information about errors via {
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ],
"extensions": {
"code": "CAN_NOT_FETCH_BY_ID",
"timestamp": "Fri Feb 9 14:33:09 UTC 2018"
}
}
]
} We have a PR for it, so closing this one in favor of: #363 |
This is how github's API exposes machine-readable error strings. We need this in our API to better be able to handle specific errors in the client. This is just a proposal to start a discussion on how to best handle this requirement 😃
For example:
Query:
Response: