You are here

trait CacheablePluginTrait in GraphQL 8.3

Trait CacheablePluginTrait

@package Drupal\graphql\Plugin\GraphQL\Traits

Hierarchy

6 files declare their use of CacheablePluginTrait
EnumPluginBase.php in src/Plugin/GraphQL/Enums/EnumPluginBase.php
FieldPluginBase.php in src/Plugin/GraphQL/Fields/FieldPluginBase.php
InputTypePluginBase.php in src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php
InterfacePluginBase.php in src/Plugin/GraphQL/Interfaces/InterfacePluginBase.php
ScalarPluginBase.php in src/Plugin/GraphQL/Scalars/ScalarPluginBase.php

... See full list

File

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

Namespace

Drupal\graphql\Plugin\GraphQL\Traits
View source
trait CacheablePluginTrait {

  /**
   * @param $definition
   *
   * @return array
   */
  protected function buildCacheContexts($definition) {
    if (!empty($definition['response_cache_contexts'])) {
      return $definition['response_cache_contexts'];
    }
    return [];
  }

}

Members