You are here

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

Expanded class hierarchy of ThunderJsonLdSchemaExtension

File

modules/thunder_gqls/src/Plugin/GraphQL/SchemaExtension/ThunderJsonLdSchemaExtension.php, line 17

Namespace

Drupal\thunder_gqls\Plugin\GraphQL\SchemaExtension
View 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')));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ResolverHelperTrait::$builder protected property ResolverBuilder.
ResolverHelperTrait::$registry protected property ResolverRegistryInterface.
ResolverHelperTrait::addFieldResolverIfNotExists protected function Add field resolver to registry, if it does not already exist.
ResolverHelperTrait::addSimpleCallbackFields public function Define callback field resolver for a type.
ResolverHelperTrait::createResolverBuilder protected function Create the ResolverBuilder.
ResolverHelperTrait::fromEntityReference public function Produces an entity_reference field.
ResolverHelperTrait::fromEntityReferenceRevisions public function Produces an entity_reference_revisions field.
ResolverHelperTrait::fromRoute public function Produces an entity from a given path.
ThunderJsonLdSchemaExtension::registerResolvers public function Overrides ThunderSchemaExtensionPluginBase::registerResolvers
ThunderSchemaExtensionPluginBase::$dataProducerManager protected property The data producer plugin manager.
ThunderSchemaExtensionPluginBase::$entityTypeManager protected property The entity type manager service.
ThunderSchemaExtensionPluginBase::create public static function
ThunderSchemaExtensionPluginBase::mapBundleToSchemaName protected function Takes the bundle name and returns the schema name.
ThunderSchemaExtensionPluginBase::resolveBaseFields protected function Add fields common to all entities.
ThunderSchemaExtensionPluginBase::resolveMediaInterfaceFields protected function Add fields common to all media types.
ThunderSchemaExtensionPluginBase::resolvePageInterfaceFields protected function Add fields common to all page types.
ThunderSchemaExtensionPluginBase::resolvePageInterfaceQueryFields protected function Add content query field resolvers.
ThunderSchemaExtensionPluginBase::resolveParagraphInterfaceFields protected function Add fields common to all media types.
ThunderSchemaExtensionPluginBase::setDataProducerManager protected function Set the plugin manager.
ThunderSchemaExtensionPluginBase::setEntityTypeManager protected function Set the entity type manager.