You are here

protected function InputTypePluginBase::buildFields in GraphQL 8.3

Builds the fields of the type definition.

Parameters

$definition: The plugin definition array.

Return value

array The list of fields for the input type.

1 call to InputTypePluginBase::buildFields()
InputTypePluginBase::getDefinition in src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php
Returns the plugin's type or field definition for the schema.

File

src/Plugin/GraphQL/InputTypes/InputTypePluginBase.php, line 57

Class

InputTypePluginBase

Namespace

Drupal\graphql\Plugin\GraphQL\InputTypes

Code

protected function buildFields($definition) {
  return array_map(function ($field) use ($definition) {
    return [
      'type' => $this
        ->buildFieldType($field, $definition),
      'description' => $this
        ->buildFieldDescription($field, $definition),
      'default' => $this
        ->buildFieldDefault($field, $definition),
    ];
  }, $definition['fields']);
}