Liking cljdoc? Tell your friends :D

fulcro.client.impl.parser

Generic query expression parsing and AST manipulation.

QUERY EXPRESSIONS

Query expressions are a variation on Datomic Pull Syntax http://docs.datomic.com/pull.html more suitable for generic client/server state transfer. It's important to note the query expression syntax is not a strict superset of Datomic Pull.

A query expression is composed of EDN values. The grammar for query expressions follows:

QueryRoot := EdnVector(QueryExpr*) PlainQueryExpr := (EdnKeyword | IdentExpr | JoinExpr) QueryExpr := (PlainQueryExpr | ParamExpr) IdentExpr := EdnVector2(Keyword, EdnValue) ParamExpr := EdnList2(PlainQueryExpr | EdnSymbol, ParamMapExpr) ParamMapExpr := EdnMap(Keyword, EdnValue) JoinExpr := EdnMap((Keyword | IdentExpr), (QueryRoot | UnionExpr | RecurExpr)) UnionExpr := EdnMap(Keyword, QueryRoot) RecurExpr := ('... | Integer)

Note most of the api expects a QueryRoot not a QueryExpr.

QUERY EXPRESSION AST FORMAT

Given a QueryExpr you can get the AST via om.next.impl.parser/expr->ast. The following keys can appear in the AST representation:

{:type (:prop | :join | :call | :root | :union | :union-entry) :key (EdnKeyword | EdnSymbol | IdentExpr) :dispatch-key (EdnKeyword | EdnSymbol) :union-key EdnKeyword :query (QueryRoot | RecurExpr) :params ParamMapExpr :children EdnVector(AST) :component Object :target EdnKeyword}

:query and :params may or may not appear. :type :call is only for mutations.

Generic query expression parsing and AST manipulation.

QUERY EXPRESSIONS

Query expressions are a variation on Datomic Pull Syntax
http://docs.datomic.com/pull.html more suitable for generic client/server
state transfer. It's important to note the query expression syntax is
*not* a strict superset of Datomic Pull.

A query expression is composed of EDN values. The grammar for query
expressions follows:

QueryRoot      := EdnVector(QueryExpr*)
PlainQueryExpr := (EdnKeyword | IdentExpr | JoinExpr)
QueryExpr      := (PlainQueryExpr | ParamExpr)
IdentExpr      := EdnVector2(Keyword, EdnValue)
ParamExpr      := EdnList2(PlainQueryExpr | EdnSymbol, ParamMapExpr)
ParamMapExpr   := EdnMap(Keyword, EdnValue)
JoinExpr       := EdnMap((Keyword | IdentExpr), (QueryRoot | UnionExpr | RecurExpr))
UnionExpr      := EdnMap(Keyword, QueryRoot)
RecurExpr      := ('... | Integer)

Note most of the api expects a QueryRoot not a QueryExpr.

QUERY EXPRESSION AST FORMAT

Given a QueryExpr you can get the AST via om.next.impl.parser/expr->ast.
The following keys can appear in the AST representation:

{:type         (:prop | :join | :call | :root | :union | :union-entry)
 :key          (EdnKeyword | EdnSymbol | IdentExpr)
 :dispatch-key (EdnKeyword | EdnSymbol)
 :union-key    EdnKeyword
 :query        (QueryRoot | RecurExpr)
 :params       ParamMapExpr
 :children     EdnVector(AST)
 :component    Object
 :target       EdnKeyword}

:query and :params may or may not appear. :type :call is only for
mutations.
raw docstring

ast->exprclj/s

(ast->expr ast)
(ast->expr {:keys [type component] ast-meta :meta :as ast} unparse?)

Given a query expression AST convert it back into a query expression.

Given a query expression AST convert it back into a query expression.
sourceraw docstring

call->astclj/s

(call->ast [f args :as call])
source

dispatchclj/s

(dispatch _ k _)
source

expr->astclj/s

(expr->ast x)

Given a query expression convert it into an AST.

Given a query expression convert it into an AST.
sourceraw docstring

ident->astclj/s

(ident->ast [k id :as ref])
source

join->astclj/s

(join->ast join)
source

keyword->astclj/s

(keyword->ast k)
source

parameterizeclj/s

(parameterize expr params)
source

parserclj/s

(parser {:keys [read mutate] :as config})

Given a :read and/or :mutate function return a parser. Refer to fulcro.client.primitives/parser for top level documentation.

Given a :read and/or :mutate function return a parser. Refer to fulcro.client.primitives/parser
for top level documentation.
sourceraw docstring

path-metaclj/s

(path-meta data path query)
(path-meta data path query union-expr)

Add path metadata to a data structure. data is the data to be worked on. path is the current path into the data. query is the query used to walk the data. union-expr tracks the last seen union query to be used when it finds a recursive union.

Add path metadata to a data structure. data is the data to be worked on.
path is the current path into the data. query is the query used to
walk the data. union-expr tracks the last seen union query to be used
when it finds a recursive union.
sourceraw docstring

query->astclj/s

(query->ast query)

Convert a query to its AST representation.

Convert a query to its AST representation.
sourceraw docstring

rethrow?clj/s

(rethrow? x)
source

symbol->astclj/s

(symbol->ast k)
source

union->astclj/s

(union->ast m)
source

union-entry->astclj/s

(union-entry->ast [k v])
source

wrap-exprclj/s

(wrap-expr root? expr)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close