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

Method resolve_graph_name_for_modification

graphlite/src/exec/executor.rs:568–594  ·  view source on GitHub ↗

Resolve graph name from graph expression for data modifications

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

Source from the content-addressed store, hash-verified

566
567 /// Resolve graph name from graph expression for data modifications
568 pub fn resolve_graph_name_for_modification(
569 &self,
570 graph_expr: Option<&GraphExpression>,
571 ) -> Result<String, ExecutionError> {
572 match graph_expr {
573 Some(GraphExpression::Reference(catalog_path)) => {
574 // Convert catalog path to graph name
575 catalog_path
576 .segments
577 .last()
578 .ok_or_else(|| ExecutionError::RuntimeError("Invalid catalog path".to_string()))
579 .cloned()
580 }
581 Some(GraphExpression::CurrentGraph) => {
582 // CurrentGraph requires session context - cannot resolve without it
583 Err(ExecutionError::RuntimeError(
584 "CurrentGraph reference requires session context for modifications".to_string(),
585 ))
586 }
587 None => Err(ExecutionError::RuntimeError(
588 "No graph specified - graph must be explicitly provided".to_string(),
589 )),
590 Some(GraphExpression::Union { .. }) => Err(ExecutionError::RuntimeError(
591 "Union graphs not supported for data modifications".to_string(),
592 )),
593 }
594 }
595
596 /// Start a transaction with session context
597 pub fn start_transaction_with_session(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected