#[derive(Debug, Clone, PartialEq)]
pub struct GqlQuery {
pub match_pattern: Vec<PathSegment>,
pub where_pred: Option<GqlPredicate>,
pub return_vars: Vec<String>,
}
#[derive(Debug, Clone, PartialEq)]
pub enum PathSegment {
Node(NodePattern),
Edge(EdgePattern),
}
#[derive(Debug, Clone, PartialEq)]
pub struct NodePattern {
pub var: Option<String>,
pub label: Option<String>,
pub props: Vec<(String, GqlLiteral)>,
}
#[derive(Debug, Clone, PartialEq)]
pub struct EdgePattern {
pub var: Option<String>,
pub label: Option<String>,
pub direction: EdgeDirection,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum EdgeDirection {
Forward,
Backward,
}
#[derive(Debug, Clone, PartialEq)]
pub enum GqlLiteral {
Str(String),
Int(i64),
Float(f64),
Bool(bool),
}
#[derive(Debug, Clone, PartialEq)]
pub struct GqlPredicate {
pub var: String,
pub prop: String,
pub value: GqlLiteral,
}