You are here

public function FieldContext::hasContextValue in GraphQL 8.4

Checks whether contextual value for the current field exists.

Also checks ancestors of the field.

Parameters

string $name: The name of the context.

Return value

bool TRUE if the context exists, FALSE Otherwise.

File

src/GraphQL/Execution/FieldContext.php, line 116

Class

FieldContext
Context that is passed to data producer plugins.

Namespace

Drupal\graphql\GraphQL\Execution

Code

public function hasContextValue($name) {
  return $this->context
    ->hasContextValue($this->info, $name);
}