From the specs
GraphQL servers may provide additional entries to error as they choose to produce more helpful or machine‐readable errors, however future versions of the spec may describe additional entries to errors.
As far as I understand, we should be able to define custom properties to errors that are being exposed to the GraphQL response. Like this:
{
"errors": [
{
"message": "Name for character with ID 1002 could not be fetched.",
+ "type": "NOT_FOUND",
"locations": [ { "line": 6, "column": 7 } ],
"path": [ "hero", "heroFriends", 1, "name" ]
}
],
"data": {
"hero": {
"name": "R2-D2",
"heroFriends": [
{
"id": "1000",
"name": "Luke Skywalker"
},
null,
{
"id": "1003",
"name": "Leia Organa"
}
]
}
}
}
Is this currently possible? Should we consider adding it to this library?
From the specs
As far as I understand, we should be able to define custom properties to errors that are being exposed to the GraphQL response. Like this:
Is this currently possible? Should we consider adding it to this library?