You are here

TimestampScalar.php in GraphQL 8.3

File

src/Plugin/GraphQL/Scalars/Internal/TimestampScalar.php
View source
<?php

namespace Drupal\graphql\Plugin\GraphQL\Scalars\Internal;

use Drupal\graphql\Plugin\GraphQL\Scalars\ScalarPluginBase;
use Drupal\graphql\Plugin\SchemaBuilderInterface;
use Drupal\graphql\Plugin\TypePluginManager;
use GraphQL\Type\Definition\IntType;

/**
 * @GraphQLScalar(
 *   id = "timestamp",
 *   name = "Timestamp",
 *   type = "timestamp"
 * )
 */
class TimestampScalar extends ScalarPluginBase {

  /**
   * {@inheritdoc}
   */
  public static function createInstance(SchemaBuilderInterface $builder, TypePluginManager $manager, $definition, $id) {
    return new IntType([
      'name' => 'Timestamp',
    ]);
  }

}

Classes

Namesort descending Description
TimestampScalar Plugin annotation @GraphQLScalar( id = "timestamp", name = "Timestamp", type = "timestamp" )