// Package gqlparser is a thin public re-export of the GQL parser front-end // (gql/internal/parser and gql/internal/ast), which Go forbids importing // from outside this module. It is the only fork-specific addition and holds // no engine logic: Parse and Desugar delegate to the upstream packages, and // the names below are type aliases, so values are interchangeable with the // internal ones. // // Consumers wanting only syntax (no chickpeas store) build their own // binder/executor on top of Parse + Desugar.
package gqlparser import ( ) // Parse parses one GQL statement into an AST. func ( string) (*Query, error) { return parser.Parse() } // Query modes. const ( Run = ast.Run Explain = ast.Explain Profile = ast.Profile ) // Union kinds. const ( UnionDistinct = ast.UnionDistinct UnionAll = ast.UnionAll UnionExcept = ast.UnionExcept UnionIntersect = ast.UnionIntersect ) // Relationship directions. const ( DirOut = ast.DirOut DirIn = ast.DirIn DirBoth = ast.DirBoth ) // Label expression kinds. const ( LabelName = ast.LabelName LabelAnd = ast.LabelAnd LabelOr = ast.LabelOr LabelNot = ast.LabelNot LabelWild = ast.LabelWild ) // Cost kinds. const ( CostProperty = ast.CostProperty CostConstant = ast.CostConstant CostExpr = ast.CostExpr ) // Unary operators. const ( Not = ast.Not Neg = ast.Neg ) // Binary operators. const ( OpOr = ast.OpOr OpAnd = ast.OpAnd OpEq = ast.OpEq OpNeq = ast.OpNeq OpLt = ast.OpLt OpLte = ast.OpLte OpGt = ast.OpGt OpGte = ast.OpGte OpAdd = ast.OpAdd OpSub = ast.OpSub OpMul = ast.OpMul OpDiv = ast.OpDiv OpStartsWith = ast.OpStartsWith OpEndsWith = ast.OpEndsWith OpContains = ast.OpContains OpXor = ast.OpXor OpConcat = ast.OpConcat ) // Literal kinds. const ( LitInt = ast.LitInt LitFloat = ast.LitFloat LitStr = ast.LitStr LitBool = ast.LitBool LitNull = ast.LitNull LitParam = ast.LitParam LitNamedParam = ast.LitNamedParam ) // List-predicate quantifiers. const ( QuantAll = ast.QuantAll QuantAny = ast.QuantAny QuantNone = ast.QuantNone QuantSingle = ast.QuantSingle ) // Map-projection entry kinds. const ( MapProjProp = ast.MapProjProp MapProjField = ast.MapProjField MapProjAll = ast.MapProjAll ) // Query and clause AST nodes. type ( QueryMode = ast.QueryMode UnionKind = ast.UnionKind Query = ast.Query QueryPart = ast.QueryPart Clause = ast.Clause Match = ast.Match With = ast.With ShortestPath = ast.ShortestPath CallProc = ast.CallProc YieldItem = ast.YieldItem PathBind = ast.PathBind Unwind = ast.Unwind CallSubquery = ast.CallSubquery Projection = ast.Projection ReturnItem = ast.ReturnItem SortItem = ast.SortItem Pattern = ast.Pattern PatternHop = ast.PatternHop NodePat = ast.NodePat PropEntry = ast.PropEntry PropExprEntry = ast.PropExprEntry LabelKind = ast.LabelKind LabelExpr = ast.LabelExpr Dir = ast.Dir RelPat = ast.RelPat VarLength = ast.VarLength CostKind = ast.CostKind CostSpec = ast.CostSpec ) // Expression AST nodes. type ( Expr = ast.Expr Lit = ast.Lit Var = ast.Var Prop = ast.Prop Unary = ast.Unary Binary = ast.Binary Func = ast.Func ListExpr = ast.ListExpr In = ast.In IsNull = ast.IsNull IsTruth = ast.IsTruth IsTyped = ast.IsTyped CaseWhen = ast.CaseWhen Case = ast.Case Cost = ast.Cost Exists = ast.Exists CountSub = ast.CountSub Quant = ast.Quant ListPred = ast.ListPred Reduce = ast.Reduce ListComp = ast.ListComp PatternComp = ast.PatternComp Index = ast.Index Slice = ast.Slice PropOf = ast.PropOf MapProjEntryKind = ast.MapProjEntryKind MapProjEntry = ast.MapProjEntry MapProj = ast.MapProj MapField = ast.MapField MapLit = ast.MapLit HasLabelExpr = ast.HasLabelExpr UnOp = ast.UnOp BinOp = ast.BinOp LitKind = ast.LitKind Literal = ast.Literal ) // Literal constructors. // IntLit returns an integer literal. func ( int64) Literal { return ast.IntLit() } // FloatLit returns a float literal. func ( float64) Literal { return ast.FloatLit() } // StrLit returns a string literal. func ( string) Literal { return ast.StrLit() } // BoolLit returns a boolean literal. func ( bool) Literal { return ast.BoolLit() } // NullLit returns the null literal. func () Literal { return ast.NullLit() } // ParamLit returns an auto-lifted parameter slot literal. func ( uint32) Literal { return ast.ParamLit() } // NamedParamLit returns a named parameter literal. func ( string) Literal { return ast.NamedParamLit() }