You are here

protected function CacheablePluginTrait::buildCacheContexts in GraphQL 8.3

Parameters

$definition:

Return value

array

6 calls to CacheablePluginTrait::buildCacheContexts()
EnumPluginBase::getDefinition in src/Plugin/GraphQL/Enums/EnumPluginBase.php
Returns the plugin's type or field definition for the schema.
FieldPluginBase::getDefinition in src/Plugin/GraphQL/Fields/FieldPluginBase.php
Returns the plugin's type or field definition for the schema.
InputTypePluginBase::getDefinition in src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php
Returns the plugin's type or field definition for the schema.
InterfacePluginBase::getDefinition in src/Plugin/GraphQL/Interfaces/InterfacePluginBase.php
Returns the plugin's type or field definition for the schema.
ScalarPluginBase::getDefinition in src/Plugin/GraphQL/Scalars/ScalarPluginBase.php
Returns the plugin's type or field definition for the schema.

... See full list

File

src/Plugin/GraphQL/Traits/CacheablePluginTrait.php, line 17

Class

CacheablePluginTrait
Trait CacheablePluginTrait

Namespace

Drupal\graphql\Plugin\GraphQL\Traits

Code

protected function buildCacheContexts($definition) {
  if (!empty($definition['response_cache_contexts'])) {
    return $definition['response_cache_contexts'];
  }
  return [];
}