Callback.php in GraphQL 8.4
File
src/GraphQL/Resolver/Callback.php
View source
<?php
namespace Drupal\graphql\GraphQL\Resolver;
use Drupal\graphql\GraphQL\Execution\FieldContext;
use Drupal\graphql\GraphQL\Execution\ResolveContext;
use GraphQL\Type\Definition\ResolveInfo;
class Callback implements ResolverInterface {
protected $callback;
public function __construct(callable $callback) {
$this->callback = $callback;
}
public function resolve($value, $args, ResolveContext $context, ResolveInfo $info, FieldContext $field) {
$result = ($this->callback)($value, $args, $context, $info, $field);
return $result;
}
}
Classes
Name |
Description |
Callback |
Resolves by invoking a callback for the field. |