You are here

public function Value::resolve in GraphQL 8.4

Resolve values for the fields.

Parameters

mixed $value:

mixed $args:

\Drupal\graphql\GraphQL\Execution\ResolveContext $context:

\GraphQL\Type\Definition\ResolveInfo $info:

\Drupal\graphql\GraphQL\Execution\FieldContext $field:

Return value

mixed

Overrides ResolverInterface::resolve

File

src/GraphQL/Resolver/Value.php, line 34

Class

Value
Resolves by returning the fixed value itself.

Namespace

Drupal\graphql\GraphQL\Resolver

Code

public function resolve($value, $args, ResolveContext $context, ResolveInfo $info, FieldContext $field) {
  if ($this->value instanceof CacheableDependencyInterface) {
    $context
      ->addCacheableDependency($this->value);
  }
  return $this->value;
}