public function EntityBuffer::add in GraphQL 8.3
Same name and namespace in other branches
- 8.4 src/GraphQL/Buffers/EntityBuffer.php \Drupal\graphql\GraphQL\Buffers\EntityBuffer::add()
Add an item to the buffer.
Parameters
string $type: The entity type of the given entity ids.
array|int $id: The entity id(s) to load.
Return value
\Closure The callback to invoke to load the result for this buffer item.
File
- src/
GraphQL/ Buffers/ EntityBuffer.php, line 37
Class
Namespace
Drupal\graphql\GraphQL\BuffersCode
public function add($type, $id) {
$item = new \ArrayObject([
'type' => $type,
'id' => $id,
]);
return $this
->createBufferResolver($item);
}