You are here

public function DataProducerPluginCachingTrait::edgeCachePrefix in GraphQL 8.4

File

src/Plugin/GraphQL/DataProducer/DataProducerPluginCachingTrait.php, line 15

Class

DataProducerPluginCachingTrait
Cache prefix implementation for data producers.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer

Code

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));
}