Helpers to manipulate EQL.
Helpers to manipulate EQL.
(ast-contains-wildcard? {:keys [children]})
Check if some of the AST children is the wildcard value, which is *.
Check if some of the AST children is the wildcard value, which is *.
(data->query data)
Helper function to transform a data into an output shape.
Helper function to transform a data into an output shape.
(ident-key key)
When key is an ident, return the first part of it. Otherwise returns nil.
When key is an ident, return the first part of it. Otherwise returns nil.
(map-select env source tx)
Starting from a map, do a EQL selection on that map. Think of this function as a power up version of select-keys.
Example: (p/map-select {:foo "bar" :deep {:a 1 :b 2}} [{:deep [:a]}]) => {:deep {:a 1}}
Starting from a map, do a EQL selection on that map. Think of this function as a power up version of select-keys. Example: (p/map-select {:foo "bar" :deep {:a 1 :b 2}} [{:deep [:a]}]) => {:deep {:a 1}}
(map-select-ast {:com.wsscode.pathom3.format.eql/keys [map-select-include]
:as env}
source
ast)
Same as map-select, but using AST as source.
Same as map-select, but using AST as source.
(maybe-merge-union-ast ast)
Check if AST entry is a union, if so it computes a new AST entry by combining all union paths as a single entry.
Check if AST entry is a union, if so it computes a new AST entry by combining all union paths as a single entry.
(pick-union-entry ast m)
Check if ast children is a union type. If so, makes a decision to choose a path and return that AST.
Check if ast children is a union type. If so, makes a decision to choose a path and return that AST.
(query-root-properties query)
Returns a vector with the properties at the root of the query.
For example:
(query-root-properties [{:a [:b]} :c]) => [:a :c]
In case the query is a union query, it will merge the roots of then will merge:
(query-root-properties {:foo [{:a [:b]} :c] :bar [:a :d]}) => [:a :c :d]
Returns a vector with the properties at the root of the query. For example: (query-root-properties [{:a [:b]} :c]) => [:a :c] In case the query is a union query, it will merge the roots of then will merge: (query-root-properties {:foo [{:a [:b]} :c] :bar [:a :d]}) => [:a :c :d]
(union->root ast)
Convert a union entry to a root.
Convert a union entry to a root.
(union-children ast)
Get union children when its an union, otherwise return nil.
Get union children when its an union, otherwise return nil.
(union-children? ast)
Given an AST point, check if the children is a union query type.
Given an AST point, check if the children is a union query type.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close