From cada291575f08b18190cddf7879ccb1f0b1d3741 Mon Sep 17 00:00:00 2001 From: kirill Date: Wed, 13 Dec 2017 11:08:34 +0800 Subject: [PATCH 1/5] Add description to custom-scalar types --- Config/CustomScalarTypeDefinition.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Config/CustomScalarTypeDefinition.php b/Config/CustomScalarTypeDefinition.php index a31287f39..841595bd8 100644 --- a/Config/CustomScalarTypeDefinition.php +++ b/Config/CustomScalarTypeDefinition.php @@ -14,6 +14,7 @@ public function getDefinition() $node ->children() ->append($this->nameSection()) + ->append($this->descriptionSection()) ->variableNode('serialize')->isRequired()->end() ->variableNode('parseValue')->isRequired()->end() ->variableNode('parseLiteral')->isRequired()->end() From 0eb5e023682a20039b6e717c5d5434d849f7281f Mon Sep 17 00:00:00 2001 From: kirill Date: Wed, 13 Dec 2017 11:12:40 +0800 Subject: [PATCH 2/5] Add description field to functional test --- Tests/Functional/App/config/customScalar/mapping/Query.types.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Tests/Functional/App/config/customScalar/mapping/Query.types.yml b/Tests/Functional/App/config/customScalar/mapping/Query.types.yml index f28d9db20..70a85d6df 100644 --- a/Tests/Functional/App/config/customScalar/mapping/Query.types.yml +++ b/Tests/Functional/App/config/customScalar/mapping/Query.types.yml @@ -1,6 +1,7 @@ DateTime: type: custom-scalar config: + description: "The DateTime type" serialize: ["Overblog\\GraphQLGenerator\\Tests\\DateTimeType", "serialize"] parseValue: ["Overblog\\GraphQLGenerator\\Tests\\DateTimeType", "parseValue"] parseLiteral: ["Overblog\\GraphQLGenerator\\Tests\\DateTimeType", "parseLiteral"] From 77fb40d34ed9e509a695b245a3e5e0e715f55a05 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Wed, 13 Dec 2017 08:03:12 +0100 Subject: [PATCH 3/5] Improve custom scalar description test --- Tests/Functional/Type/CustomScalarTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Tests/Functional/Type/CustomScalarTest.php b/Tests/Functional/Type/CustomScalarTest.php index 962073821..17bdcb636 100644 --- a/Tests/Functional/Type/CustomScalarTest.php +++ b/Tests/Functional/Type/CustomScalarTest.php @@ -30,4 +30,10 @@ public function testDateTimeTypeParseValue() ]; $this->assertGraphQL($query, $expected); } + + public function testDateTimeTypeDescription() + { + $dateTimeType = static::$kernel->getContainer()->get('overblog_graphql.type_resolver')->resolve('DateTime'); + $this->assertEquals('The DateTime type', $dateTimeType->description); + } } From 0a6272db33ee7c963975a47d55e5552fb0a82778 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Wed, 13 Dec 2017 08:11:21 +0100 Subject: [PATCH 4/5] Bump "overblog/graphql-php-generator" version --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 2bd8e4180..ac8c552d5 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require": { "php": ">=5.6", "doctrine/doctrine-cache-bundle": "^1.2", - "overblog/graphql-php-generator": "^0.6.0", + "overblog/graphql-php-generator": "^0.7.0", "symfony/cache": "^3.1 || ^4.0", "symfony/config": "^3.1 || ^4.0", "symfony/dependency-injection": "^3.1 || ^4.0", @@ -39,7 +39,7 @@ "symfony/framework-bundle": "^3.1 || ^4.0", "symfony/options-resolver": "^3.1 || ^4.0", "symfony/property-access": "^3.1 || ^4.0", - "webonyx/graphql-php": "^0.10.0 || ^0.11.0" + "webonyx/graphql-php": "^0.11.2" }, "suggest": { "nelmio/cors-bundle": "For more flexibility when using CORS prefight", From 130116985923944011dbeea7b32c41a75adbab08 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Wed, 13 Dec 2017 08:12:59 +0100 Subject: [PATCH 5/5] Remove test for graphql-php 0.10 version --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0de2a4d6a..44f529d8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: - php: 7.2 env: SYMFONY_VERSION=3.3.* - php: 7.2 - env: SYMFONY_VERSION=3.4.* GRAPHQLPHP_VERSION=0.10.0 DEPENDENCIES=dev + env: SYMFONY_VERSION=3.4.* - php: 7.2 env: SYMFONY_VERSION=4.0.* TEST_COVERAGE=true - php: 7.2