You are here

public function EntityUrl::resolve in GraphQL 8.4

Resolver.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

Return value

\Drupal\Core\Url

Throws

\Drupal\Core\Entity\EntityMalformedException

File

src/Plugin/GraphQL/DataProducer/Entity/EntityUrl.php, line 36

Class

EntityUrl
Returns the URL of an entity.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\Entity

Code

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