You are here

public function Reference::resolve in GraphQL 8.4

Resolves the "reference" property.

Parameters

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

Return value

bool If the field is referencing entities (is the entity reference type).

File

src/Plugin/GraphQL/DataProducer/EntityDefinition/Fields/Reference.php, line 36

Class

Reference
Retrieves the "reference" property from a given field definition.

Namespace

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

Code

public function resolve(FieldDefinitionInterface $entity_definition_field) : bool {
  return $entity_definition_field
    ->getType() === 'entity_reference';
}