Spec compliant error
See original GitHub issueRecently, GraphQL Response Specification got updated with a suggestion to place custom data in error in the extensions
object. The spec can be found here https://github.com/facebook/graphql/blob/master/spec/Section 7 -- Response.md
An excerpt of the relevant section:
GraphQL services may provide an additional entry to errors with key
extensions
. This entry, if set, must have a map as its value. This entry is reserved for implementors to add additional information to errors however they see fit, and there are no additional restrictions on its contents.
{
"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"
}
}
]
}
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Error message for non-spec-compliant links #178
We might want to show an error message if the link is not valid syntax, instead of just a blank screen. The text...
Read more >"Stop error code 0x000000A5" error when you are ...
This behavior can occur if Windows has detected that the BIOS in the computer is not fully compliant with Advanced Configuration and Power...
Read more >JSON:API error object's links object should be spec compliant
Drupal's JSON:API error objects currently contain a links member with info and via members. With JSON:API 1.1 forthcoming, allowed values in the spec...
Read more >[2012.10211] Looking for non-compliant documents using ...
Bugs within both the parser and the format specification mean that a compliant file may fail to parse, or that a non-compliant file...
Read more >react native - TypeError: In this environment the sources for ...
This error is a performance optimization and not spec compliant · Ask Question. Asked 4 years, 9 months ago. Modified 4 years, 8...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Can we create a second PR for this? I’d like to release in 2.0
@thebigredgeek I’m using this heavily in a few projects and plan on releasing an open source boilerplate that includes it, I’m more than willing to help maintain it.