public function ConfigEntityTypeResolver::applies in GraphQL 8.2
Same name and namespace in other branches
- 8 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\TypeResolverCode
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;
}