You are here

protected function SubRequestBuffer::getBufferId in GraphQL 8.3

Parameters

object $item: The item to get the buffer id for.

Return value

string The buffer id.

Overrides BufferBase::getBufferId

File

src/GraphQL/Buffers/SubRequestBuffer.php, line 66

Class

SubRequestBuffer

Namespace

Drupal\graphql\GraphQL\Buffers

Code

protected function getBufferId($item) {

  /** @var \Drupal\Core\GeneratedUrl $url */
  $url = $item['url']
    ->toString(TRUE);
  return hash('sha256', json_encode([
    'url' => $url
      ->getGeneratedUrl(),
    'tags' => $url
      ->getCacheTags(),
    'contexts' => $url
      ->getCacheContexts(),
    'age' => $url
      ->getCacheMaxAge(),
  ]));
}