You are here

public function EntityType::resolve in GraphQL 8.4

Resolver.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

Return value

string

File

src/Plugin/GraphQL/DataProducer/Entity/EntityType.php, line 34

Class

EntityType
Returns the entity type name of an entity.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\Entity

Code

public function resolve(EntityInterface $entity) {
  return $entity
    ->getEntityTypeId();
}