mirror of
https://github.com/retailcrm/graphql-php.git
synced 2024-11-29 00:25:17 +03:00
TASK: Allow UnionType extensions
This commit is contained in:
parent
1dc2b939cb
commit
0c33cfa88f
@ -6,6 +6,7 @@ namespace GraphQL\Type\Definition;
|
|||||||
|
|
||||||
use GraphQL\Error\InvariantViolation;
|
use GraphQL\Error\InvariantViolation;
|
||||||
use GraphQL\Language\AST\UnionTypeDefinitionNode;
|
use GraphQL\Language\AST\UnionTypeDefinitionNode;
|
||||||
|
use GraphQL\Language\AST\UnionTypeExtensionNode;
|
||||||
use GraphQL\Utils\Utils;
|
use GraphQL\Utils\Utils;
|
||||||
use function call_user_func;
|
use function call_user_func;
|
||||||
use function is_array;
|
use function is_array;
|
||||||
@ -27,6 +28,9 @@ class UnionType extends Type implements AbstractType, OutputType, CompositeType,
|
|||||||
/** @var ObjectType[] */
|
/** @var ObjectType[] */
|
||||||
private $possibleTypeNames;
|
private $possibleTypeNames;
|
||||||
|
|
||||||
|
/** @var UnionTypeExtensionNode[] */
|
||||||
|
public $extensionASTNodes;
|
||||||
|
|
||||||
public function __construct($config)
|
public function __construct($config)
|
||||||
{
|
{
|
||||||
if (! isset($config['name'])) {
|
if (! isset($config['name'])) {
|
||||||
@ -43,6 +47,7 @@ class UnionType extends Type implements AbstractType, OutputType, CompositeType,
|
|||||||
$this->name = $config['name'];
|
$this->name = $config['name'];
|
||||||
$this->description = $config['description'] ?? null;
|
$this->description = $config['description'] ?? null;
|
||||||
$this->astNode = $config['astNode'] ?? null;
|
$this->astNode = $config['astNode'] ?? null;
|
||||||
|
$this->extensionASTNodes = $config['extensionASTNodes'] ?? null;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user