graphql_compose-1.0.0-beta20/modules/graphql_compose_metatags/src/Plugin/GraphQLCompose/SchemaType/MetaTagInterface.php

modules/graphql_compose_metatags/src/Plugin/GraphQLCompose/SchemaType/MetaTagInterface.php
<?php

declare(strict_types=1);

namespace Drupal\graphql_compose_metatags\Plugin\GraphQLCompose\SchemaType;

use Drupal\graphql_compose\Attribute\SchemaType;
use Drupal\graphql_compose\Plugin\GraphQLCompose\GraphQLComposeSchemaTypeBase;
use GraphQL\Type\Definition\InterfaceType;
use GraphQL\Type\Definition\Type;

/**
 * {@inheritdoc}
 */
#[SchemaType(
  id: "MetaTagInterface",
)]
class MetaTagInterface extends GraphQLComposeSchemaTypeBase {

  /**
   * {@inheritdoc}
   */
  public function getTypes(): array {
    $types = [];

    $types[] = new InterfaceType([
      'name' => $this->getPluginId(),
      'description' => (string) $this->t("This entity has meta tags enabled."),
      'fields' => fn() => [
        'metatag' => [
          'type' => Type::nonNull(Type::listOf(Type::nonNull(static::type('MetaTagUnion')))),
          'description' => (string) $this->t('The computed meta tags for the entity.'),
        ],
      ],
    ]);

    return $types;
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc