You are here

public static function LanguageTypeResolver::getName in GraphQL 8

Same name and namespace in other branches
  1. 8.2 src/TypeResolver/LanguageTypeResolver.php \Drupal\graphql\TypeResolver\LanguageTypeResolver::getName()

Gets the name of the language.

Parameters

\Drupal\Core\TypedData\Plugin\DataType\Language: The language object.

Return value

string The human-readable name of the language (in the language that was The human-readable name of the language (in the language that was used to construct this object).

File

src/TypeResolver/LanguageTypeResolver.php, line 86

Class

LanguageTypeResolver
Resolves the schema for the 'language' data type.

Namespace

Drupal\graphql\TypeResolver

Code

public static function getName(Language $language) {
  return $language
    ->getValue()
    ->getName();
}