protected function BufferBase::createResolver in GraphQL 8.4
Same name and namespace in other branches
- 8.3 src/GraphQL/Buffers/BufferBase.php \Drupal\graphql\GraphQL\Buffers\BufferBase::createResolver()
Creates a callback to invoke to load the result for this buffer item.
Parameters
object $item: The item to add to create the resolver for.
\SplObjectStorage $buffer: The buffer.
\SplObjectStorage $result: The result set.
Return value
\Closure The callback to invoke to load the result for this buffer item.
1 call to BufferBase::createResolver()
- BufferBase::createBufferResolver in src/
GraphQL/ Buffers/ BufferBase.php - Helper function to create a resolver for a singular buffer.
File
- src/
GraphQL/ Buffers/ BufferBase.php, line 76
Class
- BufferBase
- Base class for field buffering services.
Namespace
Drupal\graphql\GraphQL\BuffersCode
protected function createResolver($item, \SplObjectStorage $buffer, \SplObjectStorage $result) {
// Return the closure that will resolve and return the result for the item.
return function () use ($item, $buffer, $result) {
return $this
->resolveItem($item, $buffer, $result);
};
}