Skip to content

Latest commit

 

History

History
32 lines (28 loc) · 465 Bytes

File metadata and controls

32 lines (28 loc) · 465 Bytes

Error Handling

  • Special Error responses as collection
  • Catches thrown errors from resolvers

Example

doSomthing: (source, args, context, info) => Promise.reject(new Error('An error'))
{
  "data": {
    "doSomthing": null
  },
  "errors": [
    {
      "message": "An error",
      "locations": [
        {
          "line": 1,
          "column": 2
        }
      ],
      "path": [
        "doSomthing"
      ]
    }
  ]
}