You are here

public function EntityLanguage::resolve in GraphQL 8.4

Resolver.

Parameters

\Drupal\Core\Entity\EntityInterface $entity:

Return value

\Drupal\Core\Language\LanguageInterface

File

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

Class

EntityLanguage
Returns the language of an entity.

Namespace

Drupal\graphql\Plugin\GraphQL\DataProducer\Entity

Code

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