You are here

protected function TypedDataTypeResolver::getTypeIdentifier in GraphQL 8

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

Retrieves the unique type identifier for a specific data type.

For basic complex data types, this should be the data type identifier. However, for things like entities and field items, this must be more specific than the data type value returned by the definition object.

This is used to generate the schema type name of the complex data type object or interface for this type (e.g. entity:node:article becomes EntityNodeArticle).

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $type: The type definition for which to return the data type identifier.

Return value

string The data type identifier of the given type definition.

2 calls to TypedDataTypeResolver::getTypeIdentifier()
TypedDataTypeResolver::getPrimitiveType in src/TypeResolver/TypedDataTypeResolver.php
TypedDataTypeResolver::resolveRecursiveComplex in src/TypeResolver/TypedDataTypeResolver.php
Resolves complex data definitions.
1 method overrides TypedDataTypeResolver::getTypeIdentifier()
FieldItemTypeResolver::getTypeIdentifier in src/TypeResolver/FieldItemTypeResolver.php
Retrieves the unique type identifier for a specific data type.

File

src/TypeResolver/TypedDataTypeResolver.php, line 303

Class

TypedDataTypeResolver
Generically resolves the schema for typed data types.

Namespace

Drupal\graphql\TypeResolver

Code

protected function getTypeIdentifier(DataDefinitionInterface $type) {
  return $type
    ->getDatatype();
}