Skip to content

Commit 2d18d48

Browse files
ref!: rename delegated errors reporter
1 parent 302ad85 commit 2d18d48

5 files changed

+8
-8
lines changed

src/DelegatedErrorsReporterInterface.php src/ErrorsReporterInterface.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
use GraphQL\Error\Error;
88

9-
interface DelegatedErrorsReporterInterface
9+
/**
10+
* Help to report errors during delegate GraphQL schema execution
11+
*/
12+
interface ErrorsReporterInterface
1013
{
1114
/**
1215
* @param Error[] $errors

src/Exception/RuntimeException.php

-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66

77
class RuntimeException extends \RuntimeException implements ExceptionInterface
88
{
9-
109
}

src/Execution.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ final class Execution
1212
public static function delegate(
1313
Schema $schema,
1414
DelegatorInterface $delegator,
15-
DelegatedErrorsReporterInterface $errorsReporter = null,
15+
ErrorsReporterInterface $errorsReporter = null,
1616
): void {
1717
foreach (['query', 'mutation', 'subscription'] as $operation) {
1818
$rootType = $schema->getOperationType($operation);

src/RootFieldsResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class RootFieldsResolver
3030

3131
public function __construct(
3232
private readonly DelegatorInterface $delegator,
33-
private readonly ?DelegatedErrorsReporterInterface $delegatedErrorsReporter = null,
33+
private readonly ?ErrorsReporterInterface $delegatedErrorsReporter = null,
3434
) {
3535
$this->delegatedPromises = new \WeakMap();
3636
}

tests/ExecutionTest.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
use PHPUnit\Framework\TestCase;
1212
use XGraphQL\Delegate\DelegatorInterface;
1313
use XGraphQL\Delegate\SchemaDelegator;
14-
use XGraphQL\DelegateExecution\DelegatedErrorsReporterInterface;
14+
use XGraphQL\DelegateExecution\ErrorsReporterInterface;
1515
use XGraphQL\DelegateExecution\Execution;
16-
use XGraphQL\DelegateExecution\ExecutionDelegatorInterface;
1716
use XGraphQL\DelegateExecution\RootFieldsResolver;
18-
use XGraphQL\DelegateExecution\SchemaExecutionDelegator;
1917

2018
class ExecutionTest extends TestCase
2119
{
@@ -181,7 +179,7 @@ public function testErrorDuringDelegateExecution(): void
181179
{
182180
/** @var Error[] $delegatedErrors */
183181
$delegatedErrors = null;
184-
$reporter = $this->createMock(DelegatedErrorsReporterInterface::class);
182+
$reporter = $this->createMock(ErrorsReporterInterface::class);
185183

186184
$reporter->expects($this->once())->method('reportErrors')->willReturnCallback(
187185
function (array $errors) use (&$delegatedErrors): void {

0 commit comments

Comments
 (0)