-
Notifications
You must be signed in to change notification settings - Fork 371
Description
Hi π,
I start using your library to provide a GraphQL API endpoint. I am working on the error handling right now. I read your documentation Exceptions and Partial Data regarding this. Returning errors like described there works very well.
I am coming from the REST world and there I am used to return corresponding HTTP Status codes in case that sth went wrong. So fe. when my code throws an IllegalArgumentException somewhere, I like to return fe. HTTP status code 400 (bad request) and an error json:
{
"title": "Sth went wrong",
"message": "Some message here explaining more"
}
Can you please tell me whether sth similar is possible in graphql and with your library?
Probably not with DataFetcherResult because there, HTTP status code is always 200.
Can I throw somehow a custom graphql exception which produces a similar result like I would like it to have?
Thanks in regards for any suggestion on this. Please be patient with me, it is my 1st GQL server project π