You are here

public function ConfigEntityTypeResolver::applies in GraphQL 8

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

Parameters

mixed $type:

Return value

bool

Overrides TypeResolverInterface::applies

File

src/TypeResolver/ConfigEntityTypeResolver.php, line 34

Class

ConfigEntityTypeResolver
Resolves the schema for config entities.

Namespace

Drupal\graphql\TypeResolver

Code

public function applies($type) {
  if ($type instanceof EntityDataDefinitionInterface) {
    $entityTypeId = $type
      ->getEntityTypeId();
    $entityType = $this->entityManager
      ->getDefinition($entityTypeId);
    return $entityType
      ->isSubclassOf('\\Drupal\\Core\\Config\\Entity\\ConfigEntityInterface');
  }
  return FALSE;
}