public function ContentEntityTypeResolver::applies in GraphQL 8
Same name and namespace in other branches
- 8.2 src/TypeResolver/ContentEntityTypeResolver.php \Drupal\graphql\TypeResolver\ContentEntityTypeResolver::applies()
Parameters
mixed $type:
Return value
bool
Overrides TypedDataTypeResolver::applies
File
- src/
TypeResolver/ ContentEntityTypeResolver.php, line 68
Class
- ContentEntityTypeResolver
- Resolves the schema for content 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\\Entity\\ContentEntityInterface');
}
return FALSE;
}