Liking cljdoc? Tell your friends :D

com.wsscode.pathom.core


apply-pluginsclj/s

(apply-plugins v plugins key)
source

ast->queryclj/s

(ast->query query-ast)
source

ast-key-idclj/s

(ast-key-id ast)

DEPRECATED: use ident-value instead

DEPRECATED: use ident-value instead
sourceraw docstring

async-parserclj/s

(async-parser settings)
source

cache-hitclj/s

(cache-hit {:com.wsscode.pathom.core/keys [request-cache]} key value)
source

cachedclj/smacro

(cached env key body)
source

collapse-error-pathclj/s

(collapse-error-path m path)
source

continueclj/s

source

continue-seqclj/s

source

deep-mergeclj/s

(deep-merge & xs)
source

easy-pluginsclj/s

(easy-plugins {:com.wsscode.pathom.core/keys [plugins env]})
source

elide-ast-nodesclj/s

(elide-ast-nodes {:keys [key union-key] :as ast} elision-set)

Remove items from a query (AST) that have a key listed in the elision-set

Remove items from a query (AST) that have a key listed in the elision-set
sourceraw docstring

elide-itemsclj/s

(elide-items item-set input)

Removes any item on set item-set from the input

Removes any item on set item-set from the input
sourceraw docstring

elide-not-foundclj/s

(elide-not-found input)

Convert all ::p/not-found values of maps to nil

Convert all ::p/not-found values of maps to nil
sourceraw docstring

ensure-attrsclj/s

(ensure-attrs env attributes)
source

entityclj/s

(entity env)
(entity {:keys [parser] :as env} attributes)

Fetch the entity according to the ::entity-key. If the entity is an IAtom, it will be derefed.

If a second argument is sent, calls the parser against current element to guarantee that some fields are loaded. This is useful when you need to ensure some values are loaded in order to fetch some more complex data. NOTE: When using this call with an explicit vector of attributes the parser will not be invoked for attributes that already exist in the current value of the current entity.

Fetch the entity according to the ::entity-key. If the entity is an IAtom, it will be derefed.

If a second argument is sent, calls the parser against current element to guarantee that some fields are loaded. This
is useful when you need to ensure some values are loaded in order to fetch some more complex data. NOTE: When using
this call with an explicit vector of attributes the parser will not be invoked for attributes that already exist in
the current value of the current entity.
sourceraw docstring

entity!clj/s

(entity! {:com.wsscode.pathom.core/keys [path] :as env} attributes)
source

entity-attrclj/s

(entity-attr env attr)
(entity-attr env attr default)

Helper function to fetch a single attribute from current entity.

Helper function to fetch a single attribute from current entity.
sourceraw docstring

entity-attr!clj/s

(entity-attr! env attr)

Like entity-attr. Raises an exception if the property can't be retrieved.

Like entity-attr. Raises an exception if the property can't be retrieved.
sourceraw docstring

entity-dispatchclj/s

(entity-dispatch {:keys [ast]})

Dispatch on the first element (type) of an incoming ident.

Dispatch on the first element (type) of an incoming ident.
sourceraw docstring

env-placeholder-readerclj/s

(env-placeholder-reader {:com.wsscode.pathom.core/keys [placeholder-prefixes]
                         :as env})

Produces a reader that will respond to any keyword whose namespace is in the set (::placeholder-prefixes env). The join node logical level stays the same as the parent where the placeholder node is requested.

Produces a reader that will respond to any keyword whose namespace
is in the set `(::placeholder-prefixes env)`. The join node logical
level stays the same as the parent where the placeholder node is
requested.
sourceraw docstring

env-pluginclj/s

(env-plugin extra-env)
source

env-wrap-pluginclj/s

(env-wrap-plugin extra-env-wrapper)

This plugin receives a function that will be called to wrap the current enviroment each time the main parser is called (parser level).

This plugin receives a function that will be called to wrap the current
enviroment each time the main parser is called (parser level).
sourceraw docstring

error-handler-pluginclj/s

source

error-strclj/s

(error-str err)
source

filter-astclj/s

(filter-ast f ast)
source

ident-join-readerclj/s

(ident-join-reader env)

This reader will join on any ident join, the entity for the join will be a map containing the same key and value expressed on the ident, eg: [{[:id 123] [:id]}], the join entry will be {:id 123}.

This reader will join on any ident join, the entity for the join will be a map containing the same
key and value expressed on the ident, eg: [{[:id 123] [:id]}], the join entry will be {:id 123}.
sourceraw docstring

ident-keyclj/s

(ident-key {:keys [ast]})

The first element of an ident.

The first element of an ident.
sourceraw docstring

ident-key*clj/s

(ident-key* key)
source

ident-valueclj/s

(ident-value {:keys [ast]})

The second element of an ident

The second element of an ident
sourceraw docstring

ident-value*clj/s

(ident-value* key)
source

ident?clj/s

(ident? x)
source

joinclj/s

(join {:keys [parser ast query]
       :com.wsscode.pathom.core/keys [union-path parent-query
                                      processing-sequence]
       :as env})
(join entity {:com.wsscode.pathom.core/keys [entity-key] :as env})

Runs a parser with current sub-query. When run with an entity argument, that entity is set as the new environment value of ::entity, and the subquery is parsered with that new environment. When run without an entity it parses the current subquery in the context of whatever entity was already in ::entity of the env.

Runs a parser with current sub-query. When run with an `entity` argument, that entity is set as the new environment
value of `::entity`, and the subquery is parsered with that new environment. When run without an `entity` it
parses the current subquery in the context of whatever entity was already in `::entity` of the env.
sourceraw docstring

join-seqclj/s

(join-seq {:com.wsscode.pathom.core/keys [entity-key] :as env} coll)

Runs the current subquery against the items of the given collection.

Runs the current subquery against the items of the given collection.
sourceraw docstring

js-obj-readercljs

(js-obj-reader {:keys [query ast]
                :com.wsscode.pathom.core/keys [js-key-transform
                                               js-value-transform entity-key]
                :as env
                :or {js-key-transform name js-value-transform (fn [_ v] v)}})

Like map-reader*, but handles plain Javascript objects instead of Clojure maps.

Like map-reader*, but handles plain Javascript objects instead of Clojure maps.
sourceraw docstring

key-dispatchclj/s

(key-dispatch {:keys [ast]})
source

map-readerclj/s

(map-reader {:keys [ast query] :as env})

Map reader will try to find the ast key on the current entity and output it. When the value is a map and a sub query is present, it will apply the sub query on that value (recursively). When the value is a sequence, map-reader will do a join on each of the items (and apply sub queries if it's present and values are maps.

Map-reader will defer the read when the key is not present at entity.

Map reader will try to find the ast key on the current entity and output it. When the value is a map and a
sub query is present, it will apply the sub query on that value (recursively). When the value is a sequence,
map-reader will do a join on each of the items (and apply sub queries if it's present and values are maps.

Map-reader will defer the read when the key is not present at entity.
sourceraw docstring

map-reader*clj/s

(map-reader* {:com.wsscode.pathom.core/keys [map-key-transform
                                             map-value-transform]})

Like map-reader, but it has extra options (read from the environment): map-key-transform: (fn [key]) will transform the key on the AST before trying to match with entity key map-value-transform: (fn [key value]) will transform the output value after reading from the entity.

The reason to have a separated reader is so the plain version (map-reader) can be faster by avoiding checking the presence of transform functions.

Like map-reader, but it has extra options (read from the environment):
map-key-transform: (fn [key]) will transform the key on the AST before trying to match with entity key
map-value-transform: (fn [key value]) will transform the output value after reading from the entity.

The reason to have a separated reader is so the plain version (map-reader) can be faster by avoiding checking
the presence of transform functions.
sourceraw docstring

maybe-atomclj/s

(maybe-atom x)
source

merge-queriesclj/s

(merge-queries qa qb)
source

merge-queries*clj/s

(merge-queries* qa qb)
source

normalize-envclj/s

(normalize-env {:keys [ast] :as env})
source

parserclj/s

(parser settings)
source

pathom-readclj/s

(pathom-read {:com.wsscode.pathom.core/keys [reader process-reader] :as env}
             _
             _)

DEPRECATED: use p/parser to create your parser

DEPRECATED: use p/parser to create your parser
sourceraw docstring

pathom-read'clj/s

(pathom-read' {:com.wsscode.pathom.core/keys [reader] :as env})
source

placeholder-nodeclj/s

source

placeholder-readerclj/s

(placeholder-reader)
(placeholder-reader ns)

DEPRECATED: use env-placeholder-reader instead.

Produces a reader that will respond to any keyword with the namespace ns. The join node logical level stays the same as the parent where the placeholder node is requested.

DEPRECATED: use env-placeholder-reader instead.

Produces a reader that will respond to any keyword with the namespace ns. The join node logical level stays the same
as the parent where the placeholder node is requested.
sourceraw docstring

post-process-parser-pluginclj/s

(post-process-parser-plugin f)

Helper to create a plugin to work on the parser output. f will run once with the parser final result.

Helper to create a plugin to work on the parser output. `f` will run once with the parser final result.
sourceraw docstring

query->astclj/s

(query->ast query-expr)

Given a query expression convert it into an AST.

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

query->ast1clj/s

(query->ast1 query-expr)

Call query->ast and return the first children.

Call query->ast and return the first children.
sourceraw docstring

raise-errorsclj/s

(raise-errors data)
source

raise-mutation-result-pluginclj/s

source

raise-responseclj/s

(raise-response resp)

Mutations running through a parser all come back in a map like this {'my/mutation {:result {...}}}. This function converts that to {'my/mutation {...}}. Copied from fulcro.server.

Mutations running through a parser all come back in a map like this {'my/mutation {:result {...}}}. This function
converts that to {'my/mutation {...}}. Copied from fulcro.server.
sourceraw docstring

raw-entityclj/s

(raw-entity {:com.wsscode.pathom.core/keys [entity-key] :as env})
source

read-fromclj/s

(read-from env reader)

Runs the read process for the reading, the reader can be a function, a vector or a map:

function: will receive the environment as argument map: will dispatch from the ast key to a reader on the map value vector: will try to run each reader in sequence, when a reader returns ::p/continue it will try the next

Runs the read process for the reading, the reader can be a function, a vector or a map:

function: will receive the environment as argument
map: will dispatch from the ast key to a reader on the map value
vector: will try to run each reader in sequence, when a reader returns ::p/continue it will try the next
sourceraw docstring

read-from*clj/s

(read-from* {:keys [ast] :as env} reader)
source

remove-query-wildcardclj/s

(remove-query-wildcard query)
source

request-cache-pluginclj/s

source

settings-mutationclj/s

(settings-mutation settings)
source

swap-entity!clj/s

(swap-entity! env fn & args)

Helper to swap the current entity value.

Helper to swap the current entity value.
sourceraw docstring

union-children?clj/s

(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.
sourceraw docstring

update-actionclj/s

(update-action m f)

Helper function to update a mutation action.

Helper function to update a mutation action.
sourceraw docstring

update-childclj/s

(update-child ast key & args)

Given an AST, find the child with a given key and run update against it.

Given an AST, find the child with a given key and run update against it.
sourceraw docstring

update-recursive-depthclj/s

(update-recursive-depth ast key & args)

Given an AST, find the child with a given key and run update against it.

Given an AST, find the child with a given key and run update against it.
sourceraw docstring

wrap-add-pathclj/s

(wrap-add-path reader)
source

wrap-handle-exceptionclj/s

(wrap-handle-exception reader)
source

wrap-mutate-handle-exceptionclj/s

(wrap-mutate-handle-exception mutate)
source

wrap-normalize-envclj/s

(wrap-normalize-env parser)
source

wrap-parser-exceptionclj/s

(wrap-parser-exception parser)
source

wrap-reduce-paramsclj/s

(wrap-reduce-params reader)
source

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

× close