You are here

public function Id::resolve in GraphQL 8.4

Resolves the ID property.

Parameters

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

Return value

string The field ID.

File

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

Class

Id
Retrieves the "ID" property from a given field definition.

Namespace

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

Code

public function resolve(FieldDefinitionInterface $entity_definition_field) : string {
  return $entity_definition_field
    ->getName();
}