Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GraphQL/Resolver/LocationResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
38 changes: 38 additions & 0 deletions GraphQL/Type/DateTimeType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php

namespace BD\EzPlatformGraphQLBundle\GraphQL\Type;

use GraphQL\Language\AST\Node;

class DateTimeType
{
/**
* @param \DateTime $value
*
* @return string
*/
public static function serialize(\DateTime $value)
{
return $value->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);
}
}
7 changes: 7 additions & 0 deletions Resources/config/graphql/Field.types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion Resources/config/graphql/Query.types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down