diff --git a/GraphQL/Resolver/LocationResolver.php b/GraphQL/Resolver/LocationResolver.php index eeb1e7a..15d1ae4 100644 --- a/GraphQL/Resolver/LocationResolver.php +++ b/GraphQL/Resolver/LocationResolver.php @@ -50,7 +50,7 @@ public function resolveLocationChildren($args) { if (isset($args['id'])) { return $this->locationService->loadLocationChildren( - $this->locationService->loadLocation($args['id']) + $this->locationService->loadLocation($args['id']),0,10 )->locations; } } diff --git a/GraphQL/Type/DateTimeType.php b/GraphQL/Type/DateTimeType.php new file mode 100644 index 0000000..9593b73 --- /dev/null +++ b/GraphQL/Type/DateTimeType.php @@ -0,0 +1,38 @@ +format('Y-m-d H:i:s'); + } + + /** + * @param mixed $value + * + * @return mixed + */ + public static function parseValue($value) + { + return new \DateTime($value); + } + + /** + * @param Node $valueNode + * + * @return string + */ + public static function parseLiteral($valueNode) + { + return new \DateTime($valueNode->value); + } +} \ No newline at end of file diff --git a/Resources/config/graphql/Field.types.yml b/Resources/config/graphql/Field.types.yml index fb9738d..1b193fd 100644 --- a/Resources/config/graphql/Field.types.yml +++ b/Resources/config/graphql/Field.types.yml @@ -338,3 +338,10 @@ TextBlockFieldValue: type: "String" description: "String representation of the value" resolve: "@=value" + +#DateTime: +# type: custom-scalar +# config: +# serialize: ["BD\\EzPlatformGraphQLBundle\\GraphQL\\Type\\DateTimeType", "serialize"] +# parseValue: ["BD\\EzPlatformGraphQLBundle\\GraphQL\\Type\\DateTimeType", "parseValue"] +# parseLiteral: ["BD\\EzPlatformGraphQLBundle\\GraphQL\\Type\\DateTimeType", "parseLiteral"] \ No newline at end of file diff --git a/Resources/config/graphql/Query.types.yml b/Resources/config/graphql/Query.types.yml index 124a97e..ff0cfaa 100644 --- a/Resources/config/graphql/Query.types.yml +++ b/Resources/config/graphql/Query.types.yml @@ -17,7 +17,7 @@ Query: description: "Resolves using the unique Content id." type: "Int" remoteId: - description: "Resolves using the unique Content remote id." + description: "Resolves using the unique Remote id." type: "String" resolve: "@=resolver('Content', [args])" user: diff --git a/composer.json b/composer.json index 46e106c..ea9ac10 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "ezsystems/ezpublish-kernel": "^6.0|^7.0", - "overblog/graphql-bundle": "^0.6.0" + "overblog/graphql-bundle": "^0.7.0" }, "autoload": { "psr-4": {