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 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() 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"] 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); + } } 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",