You are here

public function Multiple::resolve in GraphQL 8.4

Resolves the "multiple" property.

Parameters

\Drupal\Core\Field\FieldDefinitionInterface $entity_definition_field: The entity field definition.

Return value

bool If the field contains multiple values or just single value.

File

src/Plugin/GraphQL/DataProducer/EntityDefinition/Fields/Multiple.php, line 37

Class

Multiple
Retrieves the "multiple" property from a given field definition.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\EntityDefinition\Fields

Code

public function resolve(FieldDefinitionInterface $entity_definition_field) : bool {
  if ($entity_definition_field instanceof FieldStorageDefinitionInterface) {
    return $entity_definition_field
      ->isMultiple();
  }
  return $entity_definition_field
    ->getFieldStorageDefinition()
    ->isMultiple();
}