You are here

public function EntityRevisionBuffer::add in GraphQL 8.4

Add an item to the buffer.

Parameters

string $type: The entity type of the given entity ids.

array|int $vid: The entity revision id(s) to load.

Return value

\Closure The callback to invoke to load the result for this buffer item.

File

src/GraphQL/Buffers/EntityRevisionBuffer.php, line 40

Class

EntityRevisionBuffer
Entity revision buffer.

Namespace

Drupal\graphql\GraphQL\Buffers

Code

public function add(string $type, $vid) : \Closure {
  $item = new \ArrayObject([
    'type' => $type,
    'vid' => $vid,
  ]);
  return $this
    ->createBufferResolver($item);
}