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

Function validate_basic_query_structure

graphlite/src/ast/validator.rs:823–841  ·  view source on GitHub ↗
(query: &BasicQuery, errors: &mut Vec<ValidationError>)

Source from the content-addressed store, hash-verified

821}
822
823fn validate_basic_query_structure(query: &BasicQuery, errors: &mut Vec<ValidationError>) {
824 // Check for required MATCH clause
825 if query.match_clause.patterns.is_empty() {
826 errors.push(ValidationError {
827 message: "Query must have at least one path pattern in MATCH clause".to_string(),
828 location: None,
829 error_type: ValidationErrorType::Structural,
830 });
831 }
832
833 // Check for required RETURN clause
834 if query.return_clause.items.is_empty() {
835 errors.push(ValidationError {
836 message: "Query must have at least one item in RETURN clause".to_string(),
837 location: None,
838 error_type: ValidationErrorType::Structural,
839 });
840 }
841}
842
843fn validate_return_query_structure(query: &ReturnQuery, errors: &mut Vec<ValidationError>) {
844 // Check for required RETURN clause items

Callers 1

validate_query_structureFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected