graphql_compose-1.0.0-beta20/src/Plugin/GraphQLCompose/SchemaType/TimestampType.php
src/Plugin/GraphQLCompose/SchemaType/TimestampType.php
<?php
declare(strict_types=1);
namespace Drupal\graphql_compose\Plugin\GraphQLCompose\SchemaType;
use Drupal\graphql_compose\Attribute\SchemaType;
use Drupal\graphql_compose\Plugin\GraphQLCompose\GraphQLComposeSchemaTypeBase;
use GraphQL\Type\Definition\CustomScalarType;
/**
* {@inheritdoc}
*/
#[SchemaType(
id: "Timestamp",
)]
class TimestampType extends GraphQLComposeSchemaTypeBase {
/**
* {@inheritdoc}
*/
public function getTypes(): array {
$types = [];
$types[] = new CustomScalarType([
'name' => $this->getPluginId(),
'description' => (string) $this->t('Type represents date and time as number of milliseconds from start of the UNIX epoch.'),
]);
return $types;
}
}
