trait DataProducerPluginCachingTrait in GraphQL 8.4
Cache prefix implementation for data producers.
Hierarchy
- trait \Drupal\graphql\Plugin\GraphQL\DataProducer\DataProducerPluginCachingTrait
File
- src/
Plugin/ GraphQL/ DataProducer/ DataProducerPluginCachingTrait.php, line 10
Namespace
Drupal\graphql\Plugin\GraphQL\DataProducerView source
trait DataProducerPluginCachingTrait {
/**
* {@inheritdoc}
*/
public function edgeCachePrefix() : string {
$contexts = array_map(function ($context) {
if ($context instanceof EntityInterface) {
return $context
->uuid();
}
return $context;
}, $this
->getContextValues());
return hash('sha256', serialize($contexts));
}
/**
* {@inheritdoc}
*/
public abstract function getContextValues();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DataProducerPluginCachingTrait:: |
public | function | ||
DataProducerPluginCachingTrait:: |
abstract public | function |