Skip to content

Commit bc93d98

Browse files
committed
rebasing branch on 2.5
1 parent 6468c4e commit bc93d98

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/GraphQl/Action/EntrypointAction.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use GraphQL\Error\Debug;
2020
use GraphQL\Error\Error;
2121
use GraphQL\Error\UserError;
22-
use GraphQL\Error\FormattedError;
2322
use GraphQL\Executor\ExecutionResult;
2423
use Symfony\Component\HttpFoundation\JsonResponse;
2524
use Symfony\Component\HttpFoundation\Request;
@@ -215,8 +214,7 @@ private function decodeVariables(string $variables): array
215214

216215
private function buildExceptionResponse(\Exception $e, int $statusCode): JsonResponse
217216
{
218-
$executionResult = (new ExecutionResult(null, [new Error($e->getMessage(), null, null, null, null, $e)]))
219-
->setErrorFormatter($this->exceptionFormatterCallback);
217+
$executionResult = new ExecutionResult(null, [new Error($e->getMessage(), null, null, null, null, $e)]);
220218

221219
return new JsonResponse($executionResult->toArray($this->debug), $statusCode);
222220
}

tests/GraphQl/Action/EntrypointActionTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ private function getEntrypointAction(array $variables = ['graphqlVariable']): En
233233

234234
$executionResultProphecy = $this->prophesize(ExecutionResult::class);
235235
$executionResultProphecy->toArray(false)->willReturn(['GraphQL']);
236-
$executionResultProphecy->setErrorFormatter(Argument::type('callable'))->willReturn($executionResultProphecy);
237236
$executionResultProphecy->setErrorFormatter($exceptionFormatterCallback)->willReturn($executionResultProphecy);
238-
$executionResultProphecy->toArray(3)->willReturn(['GraphQL']);
239237
$executorProphecy = $this->prophesize(ExecutorInterface::class);
240238
$executorProphecy->executeQuery(Argument::is($schema->reveal()), 'graphqlQuery', null, null, $variables, 'graphqlOperationName')->willReturn($executionResultProphecy->reveal());
241239

@@ -245,8 +243,6 @@ private function getEntrypointAction(array $variables = ['graphqlVariable']): En
245243
$graphiQlAction = new GraphiQlAction($twigProphecy->reveal(), $routerProphecy->reveal(), true);
246244
$graphQlPlaygroundAction = new GraphQlPlaygroundAction($twigProphecy->reveal(), $routerProphecy->reveal(), true);
247245

248-
return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $graphQlPlaygroundAction, false, true, true, 'graphiql');
249-
return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $graphQlPlaygroundAction, $exceptionFormatterFactoryProphecy->reveal(), true, true, true, 'graphiql');
250-
return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $graphQlPlaygroundAction, $exceptionFormatterCallback, true, true, true, 'graphiql');
246+
return new EntrypointAction($schemaBuilderProphecy->reveal(), $executorProphecy->reveal(), $graphiQlAction, $graphQlPlaygroundAction, $exceptionFormatterCallback, false, true, true, 'graphiql');
251247
}
252248
}

0 commit comments

Comments
 (0)