Lighthouse: How would I append an error to the error list using a custom directive?

Created on 3 Mar 2019  路  2Comments  路  Source: nuwave/lighthouse

I'm trying to create a custom directive where I want to send a GraphQL friendly error (not manually handled by me).

Is there any method we should call to append errors to the error response list?

question

Most helpful comment

@spawnia In terms of addition to the error handling docs, I think some information regarding how to handle Laravel thrown exceptions and make them more user friendly would be a great addition. For example, \Illuminate\Auth\AuthenticationException.

All 2 comments

I compiled some useful info about error handling into https://github.com/nuwave/lighthouse/pull/644

Please review the changes if there is anything missing, i can add more info if you have questions.

@spawnia In terms of addition to the error handling docs, I think some information regarding how to handle Laravel thrown exceptions and make them more user friendly would be a great addition. For example, \Illuminate\Auth\AuthenticationException.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eriktisme picture eriktisme  路  4Comments

souljacker picture souljacker  路  3Comments

alexwhb picture alexwhb  路  4Comments

wimski picture wimski  路  3Comments

mikeerickson picture mikeerickson  路  3Comments