You are here

class StaticCacheContext in GraphQL 8.4

Helper class, not sure for what.

@todo This class and service seems unused, can we remove it?

Hierarchy

Expanded class hierarchy of StaticCacheContext

1 string reference to 'StaticCacheContext'
graphql.services.yml in ./graphql.services.yml
graphql.services.yml
1 service uses StaticCacheContext
cache_context.static in ./graphql.services.yml
Drupal\graphql\Cache\Context\StaticCacheContext

File

src/Cache/Context/StaticCacheContext.php, line 13

Namespace

Drupal\graphql\Cache\Context
View source
class StaticCacheContext implements CalculatedCacheContextInterface {

  /**
   * {@inheritdoc}
   */
  public static function getLabel() {
    return t('Static');
  }

  /**
   * {@inheritdoc}
   */
  public function getContext($parameter = NULL) {
    return $parameter ?: '';
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheableMetadata($parameter = NULL) {
    return new CacheableMetadata();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
StaticCacheContext::getCacheableMetadata public function Gets the cacheability metadata for the context based on the parameter value. Overrides CalculatedCacheContextInterface::getCacheableMetadata
StaticCacheContext::getContext public function Returns the string representation of the cache context. Overrides CalculatedCacheContextInterface::getContext
StaticCacheContext::getLabel public static function Returns the label of the cache context. Overrides CalculatedCacheContextInterface::getLabel