folkloreinc / laravel-graphql

Facebook GraphQL for Laravel 5. It supports Relay, eloquent models, validation and GraphiQL.
1.76k stars 233 forks source link

Exception Handler #244

Open faiverson opened 6 years ago

faiverson commented 6 years ago

Since graphql-php library catch all possible errors and they are returned as graphQL errors, and we have a few errors that might be generated in a resolver like a DB error or any other kind (like NotFoundHttpException), imho will be better if they are pass to the Laravel handler exception class. In this category I think all the Auth and Validate Errors should throw the same errors than Laravel provides (like Illuminate\Validation\ValidationException).

If you think that it is an improvement I can work on that.

I hope the explanation is clear!

codeitlikemiley commented 6 years ago

yes , im thinking on this the same way, we can throw any errors and bubble up using laravel exception handler...