youshido-php/GraphQLBundle

How to debug exceptions?

brunoreis opened this issue · 1 comments

Exceptions are being transformed into graphql error, and this is good. But, is there an easy way to turn this off so that we can see the exception trace to debug errors?

garte commented

We've implemented our own ExecutionContext and overrode the addError class by setting our own class as a parameter named graphql.execution_context.class (simply add this value to the parameters.yml(.dist) and provide a valid class name to use).
You can get the DI container within the addError method via $this->getContainer() and use whatever services you need.