MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / resolve_graph_expression

Method resolve_graph_expression

graphlite/src/exec/executor.rs:394–416  ·  view source on GitHub ↗

Resolve a graph expression to an actual graph (helper for internal use)

(
        &self,
        _graph_expr: Option<&GraphExpression>,
    )

Source from the content-addressed store, hash-verified

392
393 /// Resolve a graph expression to an actual graph (helper for internal use)
394 fn resolve_graph_expression(
395 &self,
396 _graph_expr: Option<&GraphExpression>,
397 ) -> Result<Arc<GraphCache>, ExecutionError> {
398 // For now, ignore the graph expression and use the first available graph
399 // This is a quick fix - the proper solution is to use resolve_graph_for_execution
400 // with proper session context
401 match self.storage.list_graphs() {
402 Ok(graph_names) if !graph_names.is_empty() => {
403 let graph_name = &graph_names[0];
404 match self.storage.get_graph(graph_name)? {
405 Some(graph) => Ok(Arc::new(graph)),
406 None => Err(ExecutionError::RuntimeError(format!(
407 "Graph {} not found",
408 graph_name
409 ))),
410 }
411 }
412 _ => Err(ExecutionError::RuntimeError(
413 "No graphs available".to_string(),
414 )),
415 }
416 }
417
418 /// Create a new query executor with provided Storage and Catalog managers
419 /// This ensures we use singleton instances from SessionManager

Callers 2

execute_basic_queryMethod · 0.80

Calls 3

list_graphsMethod · 0.45
is_emptyMethod · 0.45
get_graphMethod · 0.45

Tested by

no test coverage detected