Skip to content

Commit eed4ff7

Browse files
authored
Merge pull request #2236 from alanpoulain/graphql-add-trace-debug
[GraphQL] Add trace when in debug mode
2 parents 7a8674b + 7db261f commit eed4ff7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/GraphQl/Action/EntrypointAction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function __invoke(Request $request): Response
6464
try {
6565
$executionResult = $this->executor->executeQuery($this->schemaBuilder->getSchema(), $query, null, null, $variables, $operation);
6666
} catch (\Exception $e) {
67-
$executionResult = new ExecutionResult(null, [$e]);
67+
$executionResult = new ExecutionResult(null, [$e] + ($this->debug ? ['trace' => $e->getTraceAsString()] : []));
6868
}
6969

7070
return new JsonResponse($executionResult->toArray($this->debug));

0 commit comments

Comments
 (0)