ThunderMetaTagsSchemaExtension.php in Thunder 6.2.x
File
modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderMetaTagsSchemaExtension.php
View source
<?php
namespace Drupal\thunder_gqls\Plugin\GraphQL\SchemaExtension;
use Drupal\graphql\GraphQL\ResolverRegistryInterface;
class ThunderMetaTagsSchemaExtension extends ThunderSchemaExtensionPluginBase {
public function registerResolvers(ResolverRegistryInterface $registry) {
parent::registerResolvers($registry);
$this
->addFieldResolverIfNotExists('Query', 'metatags', $this->builder
->compose($this
->fromRoute($this->builder
->fromArgument('path')), $this->builder
->produce('thunder_metatags')
->map('type', $this->builder
->fromValue('entity'))
->map('value', $this->builder
->fromParent())));
$this
->addSimpleCallbackFields('MetaTag', [
'tag',
'attributes',
]);
}
}