Closed
Description
Problem Statement
I would like to be able to report GraphQL errors and see them nicely formatted.
According to the GraphQL docs, it returns structured error data. See this and this document.
Example time by using GitHubs GraphQL explorer:
The following query returns a result:
# Query
query {
viewer {
login
}
}
// result
{
"data": {
"viewer": {
"login": "ueman"
}
}
}
If I now introduce an error to the query
# Query
query {
viewer {
# note the removed `n` at the end
logi
}
}
I'm greeted with this error
{
"errors": [
{
"path": [
"query",
"viewer",
"logi"
],
"extensions": {
"code": "undefinedField",
"typeName": "User",
"fieldName": "logi"
},
"locations": [
{
"line": 8,
"column": 5
}
],
"message": "Field 'logi' doesn't exist on type 'User'"
}
]
}
Solution Brainstorm
If I report the query and the error response, I would like to be able to see the error highlighted in the query.
Metadata
Metadata
Assignees
Labels
No labels