graphql-php
graphql-php copied to clipboard
Remove pass-by-reference for `$result` in `ReferenceExecutor`
Follows up on https://github.com/webonyx/graphql-php/pull/1776#discussion_r2411090574
Tests pass, I don't see how this change could be problematic.
Since the ReferenceExecutor is not final, one could be extending it.
For example:
final class TestReferenceExecutor extends ReferenceExecutor {
protected function completeAbstractValue(
AbstractType $returnType,
\ArrayObject $fieldNodes,
ResolveInfo $info,
array $path,
array $unaliasedPath,
&$result,
$contextValue)
{
return parent::completeAbstractValue(
$returnType,
$fieldNodes,
$info,
$path,
$unaliasedPath,
$result,
$contextValue,
);
}
}
This would fail now:
Declaration should be compatible with ReferenceExecutor->completeAbstractValue(returnType: \GraphQL\Type\Definition\AbstractType|\GraphQL\Type\Definition\Type&\GraphQL\Type\Definition\AbstractType, fieldNodes: \ArrayObject, info: \GraphQL\Type\Definition\ResolveInfo, path: int[]|string[], unaliasedPath: int[]|string[], result: mixed, contextValue: mixed)
We do mark public elements of our API with @api, so I would categorize this as internal and non-breaking.
In that case, let's ship this! Way better indeed.
Released with https://github.com/webonyx/graphql-php/releases/tag/v15.29.3.