def METHOD_NAME(self, nodes_dict: Dict[int, QueryNode]) -> List[QueryNode]:
    """Find root node."""
    # the root node is the one that isn't a dependency of any other node
    node_counts = {node_id: 0 for node_id in nodes_dict.keys()}
    for node in nodes_dict.values():
        for dep in node.dependencies:
            node_counts[dep] += 1
    root_node_ids = [
        node_id for node_id, count in node_counts.items() if count == 0
    ]
    return [nodes_dict[node_id] for node_id in root_node_ids]