You are here

class Server in GraphQL 8.4

The main GraphQL configuration and request entry point.

Multiple GraphQL servers can be defined on different routing paths with different GraphQL schemas.

Plugin annotation


@ConfigEntityType(
  id = "graphql_server",
  label = @Translation("Server"),
  handlers = {
    "list_builder" = "Drupal\graphql\Controller\ServerListBuilder",
    "form" = {
      "edit" = "Drupal\graphql\Form\ServerForm",
      "create" = "Drupal\graphql\Form\ServerForm",
      "delete" = "Drupal\Core\Entity\EntityDeleteForm",
      "persisted_queries" = "Drupal\graphql\Form\PersistedQueriesForm"
    }
  },
  config_prefix = "graphql_servers",
  admin_permission = "administer graphql configuration",
  entity_keys = {
    "id" = "name",
    "label" = "label"
  },
  config_export = {
    "name",
    "label",
    "schema",
    "schema_configuration",
    "persisted_queries_settings",
    "endpoint",
    "debug_flag",
    "caching",
    "batching"
  },
  links = {
    "collection" = "/admin/config/graphql/servers",
    "create-form" = "/admin/config/graphql/servers/create",
    "edit-form" = "/admin/config/graphql/servers/manage/{graphql_server}",
    "delete-form" = "/admin/config/graphql/servers/manage/{graphql_server}/delete",
    "persisted_queries-form" = "/admin/config/graphql/servers/manage/{graphql_server}/persisted_queries",
  }
)

Hierarchy

Expanded class hierarchy of Server

7 files declare their use of Server
DisabledResultCacheTest.php in tests/src/Kernel/Framework/DisabledResultCacheTest.php
ExplorerMenuLinkDeriver.php in src/Plugin/MenuLink/Deriver/ExplorerMenuLinkDeriver.php
graphql.install in ./graphql.install
Install, update and uninstall functions for the GraphQL module.
HttpRequestTrait.php in tests/src/Traits/HttpRequestTrait.php
MockingTrait.php in tests/src/Traits/MockingTrait.php

... See full list

1 string reference to 'Server'
graphql.schema.yml in config/schema/graphql.schema.yml
config/schema/graphql.schema.yml

File

src/Entity/Server.php, line 73

Namespace

Drupal\graphql\Entity
View source
class Server extends ConfigEntityBase implements ServerInterface {
  use DependencySerializationTrait;

  /**
   * The server's machine-readable name.
   *
   * @var string
   */
  public $name;

  /**
   * The server's human-readable name.
   *
   * @var string
   */
  public $label;

  /**
   * The server's schema.
   *
   * @var string
   */
  public $schema;

  /**
   * Schema configuration.
   *
   * @var array
   */
  public $schema_configuration = [];

  /**
   * The debug settings for this server.
   *
   * @var int
   * @see \GraphQL\Error\DebugFlag
   */
  public $debug_flag = DebugFlag::NONE;

  /**
   * Whether the server should cache its results.
   *
   * @var bool
   */
  public $caching = TRUE;

  /**
   * Whether the server allows query batching.
   *
   * @var bool
   */
  public $batching = TRUE;

  /**
   * The server's endpoint.
   *
   * @var string
   */
  public $endpoint;

  /**
   * Persisted query plugins configuration.
   *
   * @var array
   */
  public $persisted_queries_settings = [];

  /**
   * Persisted query plugin instances available on this server.
   *
   * @var array|null
   */
  protected $persisted_query_instances = NULL;

  /**
   * The sorted persisted query plugin instances available on this server.
   *
   * @var array|null
   */
  protected $sorted_persisted_query_instances = NULL;

  /**
   * {@inheritdoc}
   */
  public function id() {
    return $this->name;
  }

  /**
   * {@inheritdoc}
   */
  public function executeOperation(OperationParams $operation) {
    $previous = Executor::getImplementationFactory();
    Executor::setImplementationFactory([
      \Drupal::service('graphql.executor'),
      'create',
    ]);
    try {
      $config = $this
        ->configuration();
      $result = (new Helper())
        ->executeOperation($config, $operation);

      // In case execution fails before the execution stage, we have to wrap the
      // result object here.
      if (!$result instanceof CacheableExecutionResult) {
        $result = new CacheableExecutionResult($result->data, $result->errors, $result->extensions);
        $result
          ->mergeCacheMaxAge(0);
      }
    } finally {
      Executor::setImplementationFactory($previous);
    }
    return $result;
  }

  /**
   * {@inheritdoc}
   */
  public function executeBatch($operations) {

    // We can't leverage parallel processing of batched queries because of the
    // contextual properties of Drupal (e.g. language manager, current user).
    return array_map(function (OperationParams $operation) {
      return $this
        ->executeOperation($operation);
    }, $operations);
  }

  /**
   * {@inheritdoc}
   *
   * @throws \Drupal\Component\Plugin\Exception\PluginException
   */
  public function configuration() {
    $params = \Drupal::getContainer()
      ->getParameter('graphql.config');

    /** @var \Drupal\graphql\Plugin\SchemaPluginManager $manager */
    $manager = \Drupal::service('plugin.manager.graphql.schema');
    $schema = $this
      ->get('schema');

    /** @var \Drupal\graphql\Plugin\SchemaPluginInterface $plugin */
    $plugin = $manager
      ->createInstance($schema);
    if ($plugin instanceof ConfigurableInterface && ($config = $this
      ->get('schema_configuration'))) {
      $plugin
        ->setConfiguration($config[$schema] ?? []);
    }

    // Create the server config.
    $registry = $plugin
      ->getResolverRegistry();
    $server = ServerConfig::create();
    $server
      ->setDebugFlag($this
      ->get('debug_flag'));
    $server
      ->setQueryBatching(!!$this
      ->get('batching'));
    $server
      ->setValidationRules($this
      ->getValidationRules());
    $server
      ->setPersistentQueryLoader($this
      ->getPersistedQueryLoader());
    $server
      ->setContext($this
      ->getContext($plugin, $params));
    $server
      ->setFieldResolver($this
      ->getFieldResolver($registry));
    $server
      ->setSchema($plugin
      ->getSchema($registry));
    $server
      ->setPromiseAdapter(new SyncPromiseAdapter());
    return $server;
  }

  /**
   * Returns to root value to use when resolving queries against the schema.
   *
   * @todo Handle this through configuration (e.g. a context value).
   *
   * May return a callable to resolve the root value at run-time based on the
   * provided query parameters / operation.
   *
   * @code
   *
   * public function getRootValue() {
   *   return function (OperationParams $params, DocumentNode $document, $operation) {
   *     // Dynamically return a root value based on the current query.
   *   };
   * }
   *
   * @endcode
   *
   * @return mixed|callable
   *   The root value for query execution or a callable factory.
   */
  protected function getRootValue() {
    return NULL;
  }

  /**
   * Returns the context object to use during query execution.
   *
   * May return a callable to instantiate a context object for each individual
   * query instead of a shared context. This may be useful e.g. when running
   * batched queries where each query operation within the same request should
   * use a separate context object.
   *
   * The returned value will be passed as an argument to every type and field
   * resolver during execution.
   *
   * @code
   *
   * public function getContext() {
   *   $shared = ['foo' => 'bar'];
   *
   *   return function (OperationParams $params, DocumentNode $document, $operation) use ($shared) {
   *     $private = ['bar' => 'baz'];
   *
   *     return new MyContext($shared, $private);
   *   };
   * }
   *
   * @endcode
   *
   * @param \Drupal\graphql\Plugin\SchemaPluginInterface $schema
   *   The schema plugin instance.
   * @param array $config
   *
   * @return mixed|callable
   *   The context object for query execution or a callable factory.
   */
  protected function getContext(SchemaPluginInterface $schema, array $config) {

    // Each document (e.g. in a batch query) gets its own resolve context. This
    // allows us to collect the cache metadata and contextual values (e.g.
    // inheritance for language) for each query separately.
    return function (OperationParams $params, DocumentNode $document, $type) use ($schema, $config) {
      $context = new ResolveContext($this, $params, $document, $type, $config);
      $context
        ->addCacheTags([
        'graphql_response',
      ]);
      if ($this instanceof CacheableDependencyInterface) {
        $context
          ->addCacheableDependency($this);
      }
      if ($schema instanceof CacheableDependencyInterface) {
        $context
          ->addCacheableDependency($schema);
      }
      return $context;
    };
  }

  /**
   * Returns the default field resolver.
   *
   * @todo Handle this through configuration on the server.
   *
   * Fields that don't explicitly declare a field resolver will use this one
   * as a fallback.
   *
   * @param \Drupal\graphql\GraphQL\ResolverRegistryInterface $registry
   *   The resolver registry.
   *
   * @return null|callable
   *   The default field resolver.
   */
  protected function getFieldResolver(ResolverRegistryInterface $registry) {
    return function ($value, $args, ResolveContext $context, ResolveInfo $info) use ($registry) {
      $field = new FieldContext($context, $info);
      $result = $registry
        ->resolveField($value, $args, $context, $info, $field);
      return DeferredUtility::applyFinally($result, function ($result) use ($field, $context) {
        if ($result instanceof CacheableDependencyInterface) {
          $field
            ->addCacheableDependency($result);
        }
        $context
          ->addCacheableDependency($field);
      });
    };
  }

  /**
   * Returns the error formatter.
   *
   * Allows to replace the default error formatter with a custom one. It is
   * essential when there is a need to adjust error format, for instance
   * to add an additional fields or remove some of the default ones.
   *
   * @return mixed|callable
   *   The error formatter.
   *
   * @see \GraphQL\Error\FormattedError::prepareFormatter
   */
  protected function getErrorFormatter() {
    return function (Error $error) {
      return FormattedError::createFromException($error);
    };
  }

  /**
   * Returns the error handler.
   *
   * @todo Handle this through configurable plugins on the server.
   *
   * Allows to replace the default error handler with a custom one. For example
   * when there is a need to handle specific errors differently.
   *
   * @return mixed|callable
   *   The error handler.
   *
   * @see \GraphQL\Executor\ExecutionResult::toArray
   */
  protected function getErrorHandler() {
    return function (array $errors, callable $formatter) {
      return array_map($formatter, $errors);
    };
  }

  /**
   * {@inheritDoc}
   */
  public function addPersistedQueryInstance(PersistedQueryPluginInterface $queryPlugin) : void {

    // Make sure the persistedQueryInstances are loaded before trying to add a
    // plugin to them.
    if (is_null($this->persisted_query_instances)) {
      $this
        ->getPersistedQueryInstances();
    }
    $this->persisted_query_instances[$queryPlugin
      ->getPluginId()] = $queryPlugin;
  }

  /**
   * {@inheritdoc}
   */
  public function removePersistedQueryInstance($queryPluginId) : void {

    // Make sure the persistedQueryInstances are loaded before trying to remove
    // a plugin from them.
    if (is_null($this->persisted_query_instances)) {
      $this
        ->getPersistedQueryInstances();
    }
    unset($this->persisted_query_instances[$queryPluginId]);
  }

  /**
   * {@inheritDoc}
   */
  public function removeAllPersistedQueryInstances() : void {
    $this->persisted_query_instances = NULL;
    $this->sorted_persisted_query_instances = NULL;
  }

  /**
   * {@inheritdoc}
   */
  public function getPersistedQueryInstances() {
    if (!is_null($this->persisted_query_instances)) {
      return $this->persisted_query_instances;
    }

    /** @var \Drupal\graphql\Plugin\PersistedQueryPluginManager $plugin_manager */
    $plugin_manager = \Drupal::service('plugin.manager.graphql.persisted_query');
    $definitions = $plugin_manager
      ->getDefinitions();
    $persisted_queries_settings = $this
      ->get('persisted_queries_settings');
    foreach ($definitions as $id => $definition) {
      if (isset($persisted_queries_settings[$id])) {
        $configuration = !empty($persisted_queries_settings[$id]) ? $persisted_queries_settings[$id] : [];
        $this->persisted_query_instances[$id] = $plugin_manager
          ->createInstance($id, $configuration);
      }
    }
    return $this->persisted_query_instances;
  }

  /**
   * {@inheritDoc}
   */
  public function getSortedPersistedQueryInstances() {
    if (!is_null($this->sorted_persisted_query_instances)) {
      return $this->sorted_persisted_query_instances;
    }
    $this->sorted_persisted_query_instances = $this
      ->getPersistedQueryInstances();
    if (!empty($this->sorted_persisted_query_instances)) {
      uasort($this->sorted_persisted_query_instances, function ($a, $b) {
        return $a
          ->getWeight() <= $b
          ->getWeight() ? -1 : 1;
      });
    }
    return $this->sorted_persisted_query_instances;
  }

  /**
   * Returns a callable for loading persisted queries.
   *
   * @return callable
   *   The persisted query loader.
   */
  protected function getPersistedQueryLoader() {
    return function ($id, OperationParams $params) {
      $sortedPersistedQueryInstances = $this
        ->getSortedPersistedQueryInstances();
      if (!empty($sortedPersistedQueryInstances)) {
        foreach ($sortedPersistedQueryInstances as $persistedQueryInstance) {
          $query = $persistedQueryInstance
            ->getQuery($id, $params);
          if (!is_null($query)) {
            return $query;
          }
        }
      }
    };
  }

  /**
   * Returns the validation rules to use for the query.
   *
   * @todo Handle this through configurable plugins on the server.
   *
   * May return a callable to allow the server to decide the validation rules
   * independently for each query operation.
   *
   * @code
   *
   * public function getValidationRules() {
   *   return function (OperationParams $params, DocumentNode $document, $operation) {
   *     if (isset($params->queryId)) {
   *       // Assume that pre-parsed documents are already validated. This allows
   *       // us to store pre-validated query documents e.g. for persisted queries
   *       // effectively improving performance by skipping run-time validation.
   *       return [];
   *     }
   *
   *     return array_values(DocumentValidator::defaultRules());
   *   };
   * }
   *
   * @endcode
   *
   * @return array|callable
   *   The validation rules or a callable factory.
   */
  protected function getValidationRules() {
    return function (OperationParams $params, DocumentNode $document, $operation) {
      if (isset($params->queryId)) {

        // Assume that pre-parsed documents are already validated. This allows
        // us to store pre-validated query documents e.g. for persisted queries
        // effectively improving performance by skipping run-time validation.
        return [];
      }
      return array_values(DocumentValidator::defaultRules());
    };
  }

  /**
   * {@inheritDoc}
   */
  public function preSave(EntityStorageInterface $storage) : void {

    // Write all the persisted queries configuration.
    $persistedQueryInstances = $this
      ->getPersistedQueryInstances();

    // Reset settings array after getting instances as it might be used when
    // obtaining them. This would break a config import containing persisted
    // queries settings as it would end up empty.
    $this->persisted_queries_settings = [];
    if (!empty($persistedQueryInstances)) {
      foreach ($persistedQueryInstances as $plugin_id => $plugin) {
        $this->persisted_queries_settings[$plugin_id] = $plugin
          ->getConfiguration();
      }
    }
    parent::preSave($storage);
  }

  /**
   * {@inheritdoc}
   *
   * @codeCoverageIgnore
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) : void {
    parent::postSave($storage, $update);
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }

  /**
   * {@inheritdoc}
   *
   * @codeCoverageIgnore
   */
  public static function postDelete(EntityStorageInterface $storage, array $entities) : void {
    parent::postDelete($storage, $entities);
    \Drupal::service('router.builder')
      ->setRebuildNeeded();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface::calculateDependencies 13
ConfigEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ConfigEntityBase::disable public function Disables the configuration entity. Overrides ConfigEntityInterface::disable 1
ConfigEntityBase::enable public function Enables the configuration entity. Overrides ConfigEntityInterface::enable
ConfigEntityBase::get public function Returns the value of a property. Overrides ConfigEntityInterface::get
ConfigEntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityBase::getCacheTagsToInvalidate 1
ConfigEntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityBase::getConfigDependencyName
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityBase::getConfigTarget
ConfigEntityBase::getDependencies public function Gets the configuration dependencies. Overrides ConfigEntityInterface::getDependencies
ConfigEntityBase::getOriginalId public function Gets the original ID. Overrides EntityBase::getOriginalId
ConfigEntityBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
ConfigEntityBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
ConfigEntityBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function Gets whether on not the data is trusted. Overrides ConfigEntityInterface::hasTrustedData
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides EntityBase::invalidateTagsOnDelete
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides EntityBase::invalidateTagsOnSave
ConfigEntityBase::isInstallable public function Checks whether this entity is installable. Overrides ConfigEntityInterface::isInstallable 2
ConfigEntityBase::isNew public function Overrides Entity::isNew(). Overrides EntityBase::isNew
ConfigEntityBase::isUninstalling public function Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface::isUninstalling
ConfigEntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase::link
ConfigEntityBase::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 7
ConfigEntityBase::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete 8
ConfigEntityBase::save public function Saves an entity permanently. Overrides EntityBase::save 1
ConfigEntityBase::set public function Sets the value of a property. Overrides ConfigEntityInterface::set
ConfigEntityBase::setOriginalId public function Sets the original ID. Overrides EntityBase::setOriginalId
ConfigEntityBase::setStatus public function Sets the status of the configuration entity. Overrides ConfigEntityInterface::setStatus
ConfigEntityBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label. 6
ConfigEntityBase::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface::status 4
ConfigEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray 2
ConfigEntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityBase::toUrl
ConfigEntityBase::trustData public function Sets that the data should be trusted. Overrides ConfigEntityInterface::trustData
ConfigEntityBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
ConfigEntityBase::url public function Gets the public URL for this entity. Overrides EntityBase::url
ConfigEntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityBase::urlInfo
ConfigEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::label public function Gets the label of the entity. Overrides EntityInterface::label 6
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 5
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::urlRouteParameters protected function Gets an array of placeholders for this entity. 2
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
Server::$batching public property Whether the server allows query batching.
Server::$caching public property Whether the server should cache its results.
Server::$debug_flag public property The debug settings for this server.
Server::$endpoint public property The server's endpoint.
Server::$label public property The server's human-readable name.
Server::$name public property The server's machine-readable name.
Server::$persisted_queries_settings public property Persisted query plugins configuration.
Server::$persisted_query_instances protected property Persisted query plugin instances available on this server.
Server::$schema public property The server's schema.
Server::$schema_configuration public property Schema configuration.
Server::$sorted_persisted_query_instances protected property The sorted persisted query plugin instances available on this server.
Server::addPersistedQueryInstance public function Adds a Persisted Query plugin instance to the persisted queries set. Overrides ServerInterface::addPersistedQueryInstance
Server::configuration public function Overrides ServerInterface::configuration
Server::executeBatch public function Execute multiple operations as batch on this server. Overrides ServerInterface::executeBatch
Server::executeOperation public function Execute an operation on this server. Overrides ServerInterface::executeOperation
Server::getContext protected function Returns the context object to use during query execution.
Server::getErrorFormatter protected function Returns the error formatter.
Server::getErrorHandler protected function Returns the error handler.
Server::getFieldResolver protected function Returns the default field resolver.
Server::getPersistedQueryInstances public function Returns the current persisted queries set. Overrides ServerInterface::getPersistedQueryInstances
Server::getPersistedQueryLoader protected function Returns a callable for loading persisted queries.
Server::getRootValue protected function Returns to root value to use when resolving queries against the schema.
Server::getSortedPersistedQueryInstances public function Returns the current persisted queries set, sorted by the plugins weight. Overrides ServerInterface::getSortedPersistedQueryInstances
Server::getValidationRules protected function Returns the validation rules to use for the query.
Server::id public function Gets the identifier. Overrides EntityBase::id
Server::postDelete public static function @codeCoverageIgnore Overrides EntityBase::postDelete
Server::postSave public function @codeCoverageIgnore Overrides EntityBase::postSave
Server::preSave public function Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBase::preSave
Server::removeAllPersistedQueryInstances public function Removes all the persisted query instances. Overrides ServerInterface::removeAllPersistedQueryInstances
Server::removePersistedQueryInstance public function Removes a Persisted Query plugin instance from the persisted queries set. Overrides ServerInterface::removePersistedQueryInstance
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function