Skip to content
Advertisement

can I throw custom error in laravel-lighthouse

is the any way that throw an error by GraphQLErrorError with no additional data except message. the current return data is

JavaScript

it contains unnecessary data

but I want something like:

JavaScript

Advertisement

Answer

You can throw your own exceptions, that will allow you to do that. Check https://lighthouse-php.com/5/digging-deeper/error-handling.html#registering-error-handlers.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement