You are here

class ParentValue in GraphQL 8.4

Resolves to the current value, which is the parent of the field.

Hierarchy

Expanded class hierarchy of ParentValue

1 file declares its use of ParentValue
ResolverBuilder.php in src/GraphQL/ResolverBuilder.php

File

src/GraphQL/Resolver/ParentValue.php, line 13

Namespace

Drupal\graphql\GraphQL\Resolver
View source
class ParentValue implements ResolverInterface {

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

}

Members

Namesort descending Modifiers Type Description Overrides
ParentValue::resolve public function Resolve values for the fields. Overrides ResolverInterface::resolve