deleteNode method
Deletes a node if it has no children
Implementation
Future<void> deleteNode(String id) async {
final children = await _repository.query(query: NodeChildrenQuery(id));
if (children.isNotEmpty) {
throw RepositoryException(
message: 'Cannot delete node with children',
);
}
await _repository.delete(id);
}