From 9ccfb93ef2fc2d56dd4f4deda615fbe58d6f8dd5 Mon Sep 17 00:00:00 2001 From: vladar Date: Sun, 30 Aug 2015 13:46:20 +0600 Subject: [PATCH] Saving original field config with field definition to allow custom app-level definitions --- src/Type/Definition/FieldDefinition.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Type/Definition/FieldDefinition.php b/src/Type/Definition/FieldDefinition.php index b8d8cf3..686a4e5 100644 --- a/src/Type/Definition/FieldDefinition.php +++ b/src/Type/Definition/FieldDefinition.php @@ -25,11 +25,7 @@ class FieldDefinition /** * source?: any, * args?: ?{[argName: string]: any}, - * context?: any, - * fieldAST?: any, - * fieldType?: any, - * parentType?: any, - * schema?: GraphQLSchema + * info * * @var callable */ @@ -45,6 +41,13 @@ class FieldDefinition */ public $deprecationReason; + /** + * Original field definition config + * + * @var array + */ + public $config; + private static $def; public static function getDefinition() @@ -55,6 +58,7 @@ class FieldDefinition 'args' => Config::arrayOf([ 'name' => Config::STRING | Config::REQUIRED, 'type' => Config::INPUT_TYPE | Config::REQUIRED, + 'description' => Config::STRING, 'defaultValue' => Config::ANY ], Config::KEY_AS_NAME), 'resolve' => Config::CALLBACK, @@ -98,6 +102,8 @@ class FieldDefinition $this->description = isset($config['description']) ? $config['description'] : null; $this->deprecationReason = isset($config['deprecationReason']) ? $config['deprecationReason'] : null; + + $this->config = $config; } /**