I'm conceptually stuck with graphsql (using graphql-js).
Lets's say the API user sends a query and the database-server is down and I'd like to return this information as an error in the in the
data { errors }
list.
How can i access the errors object in data and push my own error messages (e.g. about the database-server outage) there?
Next thing I am wondering about is how to add an addition messages object to the data object.
Let's say The user has requested a database item by id (e.g. a particular account) and that item does not exist. Now, I'd like to return something like this:
{
data: {
messages: [{status: "failure", message: "This account does not exist"}]
}
}
How would I do that and would I have to define the messages also as a type?