You are here

public static function LanguageTypeResolver::getDirection in GraphQL 8.2

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

Gets the text direction (left-to-right or right-to-left).

Parameters

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

Return value

string Either self::DIRECTION_LTR or self::DIRECTION_RTL.

File

src/TypeResolver/LanguageTypeResolver.php, line 112

Class

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

Namespace

Drupal\graphql\TypeResolver

Code

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