You are here

protected function Executor::cacheSuffix in GraphQL 8.4

Calculate the cache suffix for the current contexts.

Parameters

array $contexts:

Return value

string

2 calls to Executor::cacheSuffix()
Executor::cacheRead in src/GraphQL/Execution/Executor.php
Lookup cached results by contexts for this query.
Executor::cacheWrite in src/GraphQL/Execution/Executor.php
Store results in cache.

File

src/GraphQL/Execution/Executor.php, line 318

Class

Executor
Executes GraphQL queries with cache lookup.

Namespace

Drupal\graphql\GraphQL\Execution

Code

protected function cacheSuffix(array $contexts = []) {
  $keys = $this->contextsManager
    ->convertTokensToKeys($contexts)
    ->getKeys();
  return hash('sha256', serialize($keys));
}