You are here

protected function SchemaPluginBase::buildField in GraphQL 8.3

Retrieves the field definition for a given field reference.

Parameters

array $field: The type reference.

Return value

array The field definition.

File

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

Class

SchemaPluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\Schemas

Code

protected function buildField($field) {
  if (!isset($this->fields[$field['id']])) {
    $creator = [
      $field['class'],
      'createInstance',
    ];
    $this->fields[$field['id']] = $creator($this, $this->fieldManager, $field['definition'], $field['id']);
  }
  return $this->fields[$field['id']];
}