for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Drupal\graphql\Plugin\GraphQL\Scalars;
use Drupal\graphql\Plugin\GraphQL\SchemaBuilderInterface;
use Drupal\graphql\Plugin\GraphQL\Traits\CacheablePluginTrait;
use Drupal\graphql\Plugin\GraphQL\Traits\PluginTrait;
use Drupal\graphql\Plugin\GraphQL\TypeSystemPluginInterface;
use Youshido\GraphQL\Type\Scalar\DateTimeType;
/**
* Scalar string type.
*
* @GraphQLScalar(
* id = "date_time",
* name = "DateTime"
* )
*/
class GraphQLDateTime extends DateTimeType implements TypeSystemPluginInterface {
use PluginTrait;
use CacheablePluginTrait;
protected $format = 'Y-m-d H:i:s';
* {@inheritdoc}
public function __construct(array $configuration, $pluginId, $pluginDefinition) {
$this->constructPlugin($configuration, $pluginId, $pluginDefinition);
}
public function buildConfig(SchemaBuilderInterface $schemaManager) {
// Nothing to do here.