You are here

DurationIso8601.php in GraphQL 8.3

File

modules/graphql_core/src/Plugin/GraphQL/Scalars/TypedData/DurationIso8601.php
View source
<?php

namespace Drupal\graphql_core\Plugin\GraphQL\Scalars\TypedData;

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

/**
 * @GraphQLScalar(
 *   id = "duration_iso8601",
 *   name = "DurationIso8601",
 *   type = "duration_iso8601"
 * )
 */
class DurationIso8601 extends ScalarPluginBase {

  /**
   * {@inheritdoc}
   */
  public static function createInstance(SchemaBuilderInterface $builder, TypePluginManager $manager, $definition, $id) {
    return Type::string();
  }

}

Classes

Namesort descending Description
DurationIso8601 Plugin annotation @GraphQLScalar( id = "duration_iso8601", name = "DurationIso8601", type = "duration_iso8601" )