You are here

public function ResolveContext::getGlobal in GraphQL 8.3

Retrieve a global/static parameter value.

Parameters

string $name: The name of the global parameter.

mixed $default: An arbitrary default value in case the context is not set.

Return value

mixed|null The requested global parameter value or the given default value if the parameter is not set.

File

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

Class

ResolveContext

Namespace

Drupal\graphql\GraphQL\Execution

Code

public function getGlobal($name, $default = NULL) {
  if (isset($this->globals[$name])) {
    return $this->globals[$name];
  }
  return $default;
}