INNER CODE UNIT · Rust
root_path_score
apollographql/apollo-mcp-server · crates/apollo-schema-index/src/lib.rs:407
let mut root_path_score = *score;
// Build up root paths by looking up referencing types
let mut visited = HashSet::new();
let mut queue = VecDeque::new();
let mut root_path_count = 0usize;
// Start with the current type as a Path
queue.push_back(PathNode::new(NamedType::new_unchecked(type_name)));
while let Some(current_path) = queue.pop_front() {
if root_path_count >= options.max_paths_per_type {
break;
}
let current_type = current_path.node_type.to_string();
visited.insert(current_type.clone());
// Create a query to find the document for the current type