youshido-php / GraphQLBundle

Pure PHP implementation of GraphQL Server – Symfony Bundle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to debug exceptions?

brunoreis opened this issue · 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?

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.