class ThunderJsonLdSchemaExtension in Thunder 6.2.x
Extension to add the JSON-LD script tag query.
Plugin annotation
@SchemaExtension(
id = "thunder_jsonld",
name = "JSON-LD extension",
description = "Adds the JSON-LD script tag query.",
schema = "thunder"
)
Hierarchy
- class \Drupal\thunder_gqls\Plugin\GraphQL\SchemaExtension\ThunderSchemaExtensionPluginBase extends \Drupal\graphql\Plugin\GraphQL\SchemaExtension\SdlSchemaExtensionPluginBase uses ResolverHelperTrait
- class \Drupal\thunder_gqls\Plugin\GraphQL\SchemaExtension\ThunderJsonLdSchemaExtension
Expanded class hierarchy of ThunderJsonLdSchemaExtension
File
- modules/
thunder_gqls/ src/ Plugin/ GraphQL/ SchemaExtension/ ThunderJsonLdSchemaExtension.php, line 17
Namespace
Drupal\thunder_gqls\Plugin\GraphQL\SchemaExtensionView source
class ThunderJsonLdSchemaExtension extends ThunderSchemaExtensionPluginBase {
/**
* {@inheritdoc}
*/
public function registerResolvers(ResolverRegistryInterface $registry) {
parent::registerResolvers($registry);
$this
->addFieldResolverIfNotExists('Query', 'jsonld', $this->builder
->produce('thunder_entity_sub_request')
->map('path', $this->builder
->fromArgument('path'))
->map('key', $this->builder
->fromValue('jsonld')));
}
}