From 1d15ae7f3e57cf01c83b85a2ca91e0b7c4726138 Mon Sep 17 00:00:00 2001 From: Torsten Blindert Date: Mon, 1 Oct 2018 19:44:55 +0200 Subject: [PATCH] TASK: Allow EnumType extensions --- src/Type/Definition/EnumType.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Type/Definition/EnumType.php b/src/Type/Definition/EnumType.php index 86e6c94..638a6ef 100644 --- a/src/Type/Definition/EnumType.php +++ b/src/Type/Definition/EnumType.php @@ -7,6 +7,7 @@ namespace GraphQL\Type\Definition; use GraphQL\Error\Error; use GraphQL\Error\InvariantViolation; use GraphQL\Language\AST\EnumTypeDefinitionNode; +use GraphQL\Language\AST\EnumTypeExtensionNode; use GraphQL\Language\AST\EnumValueNode; use GraphQL\Language\AST\Node; use GraphQL\Utils\MixedStore; @@ -33,6 +34,9 @@ class EnumType extends Type implements InputType, OutputType, LeafType, NamedTyp /** @var \ArrayObject */ private $nameLookup; + /** @var EnumTypeExtensionNode[] */ + public $extensionASTNodes; + public function __construct($config) { if (! isset($config['name'])) { @@ -41,10 +45,11 @@ class EnumType extends Type implements InputType, OutputType, LeafType, NamedTyp Utils::invariant(is_string($config['name']), 'Must provide name.'); - $this->name = $config['name']; - $this->description = $config['description'] ?? null; - $this->astNode = $config['astNode'] ?? null; - $this->config = $config; + $this->name = $config['name']; + $this->description = $config['description'] ?? null; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; } /**