public function SubRequestBuffer::add in GraphQL 8.3
Add an item to the buffer.
Parameters
\Drupal\Core\Url $url: The url object to run the subrequest on.
callable $extract: The callback to run within the sub-request.
Return value
\Closure The callback to invoke to load the result for this buffer item.
File
- src/
GraphQL/ Buffers/ SubRequestBuffer.php, line 54
Class
Namespace
Drupal\graphql\GraphQL\BuffersCode
public function add(Url $url, callable $extract) {
$item = new \ArrayObject([
'url' => $url,
'extract' => $extract,
]);
return $this
->createBufferResolver($item);
}