From 1dc2b939cbb0aeed4c58739a784c7d32cf6f93f4 Mon Sep 17 00:00:00 2001 From: Torsten Blindert Date: Mon, 1 Oct 2018 19:45:36 +0200 Subject: [PATCH] TASK: Allow ScalarType extensions --- src/Type/Definition/ScalarType.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/Type/Definition/ScalarType.php b/src/Type/Definition/ScalarType.php index d93b2e7..db4e63f 100644 --- a/src/Type/Definition/ScalarType.php +++ b/src/Type/Definition/ScalarType.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace GraphQL\Type\Definition; use GraphQL\Language\AST\ScalarTypeDefinitionNode; +use GraphQL\Language\AST\ScalarTypeExtensionNode; use GraphQL\Utils\Utils; use function is_string; @@ -31,15 +32,19 @@ abstract class ScalarType extends Type implements OutputType, InputType, LeafTyp /** @var ScalarTypeDefinitionNode|null */ public $astNode; + /** @var ScalarTypeExtensionNode[] */ + public $extensionASTNodes; + /** * @param mixed[] $config */ public function __construct(array $config = []) { - $this->name = $config['name'] ?? $this->tryInferName(); - $this->description = $config['description'] ?? $this->description; - $this->astNode = $config['astNode'] ?? null; - $this->config = $config; + $this->name = $config['name'] ?? $this->tryInferName(); + $this->description = $config['description'] ?? $this->description; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; Utils::invariant(is_string($this->name), 'Must provide name.'); }