INNER CODE UNIT · Rust
Some
apollographql/apollo-mcp-server · crates/apollo-schema-index/src/lib.rs:417
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
let term = Term::from_field_text(self.raw_type_name_field, current_type.as_str());
let type_query = TermQuery::new(term, IndexRecordOption::Basic);
let type_search =
searcher.search(&type_query, &TopDocs::with_limit(1).order_by_score())?;
let current_type_doc: Option<TantivyDocument> = type_search
.first()
.and_then(|(_, type_doc_address)| searcher.doc(*type_doc_address).ok());
let referencing_types: Vec<String> = if let Some(type_doc) = current_type_doc {
type_doc
.get_all(self.referencing_types_field)