You are here

protected function SchemaPluginBase::buildMutation in GraphQL 8.3

Retrieves the mutation definition for a given field reference.

Parameters

array $mutation: The mutation reference.

Return value

array The mutation definition.

File

src/Plugin/GraphQL/Schemas/SchemaPluginBase.php, line 526

Class

SchemaPluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\Schemas

Code

protected function buildMutation($mutation) {
  if (!isset($this->mutations[$mutation['id']])) {
    $creator = [
      $mutation['class'],
      'createInstance',
    ];
    $this->mutations[$mutation['id']] = $creator($this, $this->mutationManager, $mutation['definition'], $mutation['id']);
  }
  return $this->mutations[$mutation['id']];
}