question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spec compliant error

See original GitHub issue

Recently, 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:open
  • Created 5 years ago
  • Reactions:2
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
thebigredgeekcommented, Apr 11, 2018

Can we create a second PR for this? I’d like to release in 2.0

3reactions
joshmanderscommented, Apr 1, 2018

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found