Liking cljdoc? Tell your friends :D
Mostly clj/s.
Exceptions indicated.

com.wsscode.pathom.core


?clj/s

source

add-errorclj/s

(add-error {:com.wsscode.pathom.core/keys [errors* path] :as env} e)
source

apply-pluginsclj/s

(apply-plugins v plugins key & params)
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

ast-propertiesclj/s

(ast-properties {:keys [children]})

Takes an AST and return a single set with all properties that appear in a query.

Example:

(-> [:foo {:bar [:baz]}] eql/query->ast pc/all-out-attributes) ; => #{:foo :bar :baz}

Takes an AST and return a single set with all properties that appear in a query.

Example:

(-> [:foo {:bar [:baz]}] eql/query->ast pc/all-out-attributes)
; => #{:foo :bar :baz}
sourceraw docstring

async-parserclj/s

(async-parser settings)

Create a new pathom async parser, this parser is serial and capable of waiting for core.async to continue processing, allowing async operations to happen during the parsing.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.

Create a new pathom async parser, this parser is serial and capable of waiting for core.async
to continue processing, allowing async operations to happen during the parsing.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar
to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function
must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.
sourceraw docstring

atom?clj/s

(atom? x)
source

break-valuesclj/s

source

cache-contains?clj/s

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

cache-hitclj/s

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

cache-readclj/s

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

cachedclj/smacro

(cached env key body)
source (clj)source (cljs)

cached*clj/s

(cached* env key body-fn)
source

cached-asyncclj/s

(cached-async
  {:com.wsscode.pathom.core/keys [async-request-cache-ch request-cache] :as env}
  key
  f)
source

cached-async*clj/s

(cached-async* env key f)
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

default-union-pathclj/s

(default-union-path {:keys [query] :as env})
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

elide-special-outputs-pluginclj/s

source

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

entity-value-mergeclj/s

(entity-value-merge x y)

This is used for merging new parsed attributes from entity, works like regular merge but if the value from the right direction is not found, then the previous value will be kept.

This is used for merging new parsed attributes from entity, works like regular merge but if the value from the right
direction is not found, then the previous value will be kept.
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-messageclj/s

(error-message err)
source

error-strclj/s

(error-str err)
source

exec-plugin-actionsclj/s

(exec-plugin-actions env key v & args)
source

filter-astclj/s

(filter-ast f ast)
source

focus-subqueryclj/s

source

group-plugins-by-actionclj/s

(group-plugins-by-action plugins)
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 placeholder-prefixes]
       :as env})
(join entity
      {:keys [ast query] :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.parser/keys [parallel?] :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

join-seq-parallelclj/s

(join-seq-parallel
  {:keys [query] :com.wsscode.pathom.core/keys [entity-path-cache] :as env}
  coll)
source

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

lift-placeholdersclj/s

(lift-placeholders {:com.wsscode.pathom.core/keys [placeholder-prefixes]} query)

This will lift the queries from placeholders to the same level of the query, as if there was not placeholders in it.

This will lift the queries from placeholders to the same level of the query, as if there was not placeholders in it.
sourceraw docstring

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

map-selectclj/s

(map-select map selection)

Starting from a map, do a EQL selection on that map. Think of this function as a power up version of select-keys, but supporting nested selections and placeholders using the default > namespace.

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, but supporting nested selections and placeholders
using the default `>` namespace.

Example:
(p/map-select {:foo "bar" :deep {:a 1 :b 2}} [{:deep [:a]}])
=> {:deep {:a 1}}
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

native-map?clj/s

(native-map? x)
source

normalize-atomclj/s

(normalize-atom x)
source

normalize-envclj/s

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

normalize-query-variablesclj/s

(normalize-query-variables query)

Converts ident values and param values to ::p/var.

Converts ident values and param values to ::p/var.
sourceraw docstring

optional-attributeclj/s

(optional-attribute x)
source

parallel-parserclj/s

(parallel-parser settings)

Create a new pathom parallel parser, this parser is capable of coordinating parallel data fetch. This also works as an async parser and will handle core async channels properly.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.

::p/async-request-cache-ch-size - Pathom uses internally a queue to avoid concurrency issues with concurrency, each request gets its own channel, so you can consider this size needs to accommodate the max parallelism for a single query. Default: 1024

::pp/external-wait-ignore-timeout - Sometimes external waits get stuck because a concurrency problem, this timeout will ignore external waits after some time so the request can go on. Default: 3000

::pp/max-key-iterations - there is a loop that happens when processing attributes in parallel, this loop will cause multiple iterations to happen in order for a single attribute to be processed, but in some conditions this loop can go indefinitely, to prevent this situation this option allows to control the max number of iterations, after that it will give up on processing that attribute. Default: 10

::pp/key-process-timeout - Max time allowed to run the full query. This is a cascading timeout, the first level will have the total amount. Default: 60000

::pp/processing-recheck-timer - Periodic time to run a checker to verify no parts are stuck during the processing, when nil the feature is disabled. Default: nil

Create a new pathom parallel parser, this parser is capable of coordinating parallel
data fetch. This also works as an async parser and will handle core async channels
properly.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar
to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function
must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.

::p/async-request-cache-ch-size - Pathom uses internally a queue to avoid concurrency
issues with concurrency, each request gets its own channel, so you can consider this
size needs to accommodate the max parallelism for a single query. Default: 1024

::pp/external-wait-ignore-timeout - Sometimes external waits get stuck because a concurrency
problem, this timeout will ignore external waits after some time so the request can
go on. Default: 3000

::pp/max-key-iterations - there is a loop that happens when processing attributes in
parallel, this loop will cause multiple iterations to happen in order for a single
attribute to be processed, but in some conditions this loop can go indefinitely, to
prevent this situation this option allows to control the max number of iterations, after
that it will give up on processing that attribute. Default: 10

::pp/key-process-timeout - Max time allowed to run the full query. This is a cascading
timeout, the first level will have the total amount. Default: 60000

::pp/processing-recheck-timer - Periodic time to run a checker to verify no parts are
stuck during the processing, when nil the feature is disabled. Default: nil
sourceraw docstring

paramsclj/s

(params env)

Get params from env, always returns a map.

Get params from env, always returns a map.
sourceraw docstring

parserclj/s

(parser settings)

Create a new pathom serial parser, this parser is capable of waiting for core.async to continue processing, allowing async operations to happen during the parsing.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.

Create a new pathom serial parser, this parser is capable of waiting for core.async
to continue processing, allowing async operations to happen during the parsing.

Options to tune the parser:

::p/env - Use this key to provide a default environment for the parser. This is a sugar
to use the p/env-plugin.

::p/mutate - A mutate function that will be called to run mutations, this function
must have the signature: (mutate env key params)

::p/plugins - A vector with plugins.
sourceraw docstring

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

pre-process-parser-pluginclj/s

(pre-process-parser-plugin f)

Helper to create a plugin that can view/modify the env/tx of a top-level request. f - (fn [{:keys [env tx]}] {:env new-env :tx new-tx}) If the function returns no env or tx, then the parser will not be called (aborts the parse)

Helper to create a plugin that can view/modify the env/tx of a top-level request.
f - (fn [{:keys [env tx]}] {:env new-env :tx new-tx})
If the function returns no env or tx, then the parser will not be called (aborts the parse)
sourceraw docstring

process-errorclj/s

(process-error {:com.wsscode.pathom.core/keys [process-error] :as env} e)
source

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

query-idclj/s

(query-id query)

Generates a consistent hash from the query. The query first goes to a process to remove any variables from idents and params, then we get the Clojure hash of it. You can use this to save information about a query that can be used to correlate with the query later.

Generates a consistent hash from the query. The query first goes to a process to remove any
variables from idents and params, then we get the Clojure hash of it. You can use this to save
information about a query that can be used to correlate with the query later.
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-async-loopclj/s

(request-cache-async-loop ch)
source

request-cache-pluginclj/s

DEPRECATED not required anymore, this was integrated in the main engine.

DEPRECATED not required anymore, this was integrated in the main engine.
sourceraw docstring

settings-mutationclj/s

(settings-mutation settings)
source

special-outputsclj/s

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

trace-pluginclj/s

source

transduce-childrenclj/s

(transduce-children xform {:keys [children] :as node})

Recursivelly transduce children on the AST, you can use this to apply filter/transformations on a whole AST. Each iteration of the transducer will get a single AST node to process.

(->> [:a {:b [:c :d]} :e]
     (p/query->ast)
     (p/transduce-children (remove (comp #{:a :c} :key)))
     (p/ast->query))
; => [{:b [:d]} :e]
Recursivelly transduce children on the AST, you can use this to apply filter/transformations
on a whole AST. Each iteration of the transducer will get a single AST node to process.

```
(->> [:a {:b [:c :d]} :e]
     (p/query->ast)
     (p/transduce-children (remove (comp #{:a :c} :key)))
     (p/ast->query))
; => [{:b [:d]} :e]
```
sourceraw docstring

transduce-mapsclj/s

(transduce-maps xform input)

Walk the structure and transduce every map with xform.

Walk the structure and transduce every map with xform.
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-attribute-paramclj/s

(update-attribute-param x f & args)

Add attribute param, eg:

(p/update-attribute-param :keyword assoc :foo "bar") => (:keyword {:foo "bar"})
(p/update-attribute-param '(:keyword {:param "prev"}) assoc :foo "bar") => (:keyword {:foo "bar" :param "prev"})
Add attribute param, eg:

```
(p/update-attribute-param :keyword assoc :foo "bar") => (:keyword {:foo "bar"})
(p/update-attribute-param '(:keyword {:param "prev"}) assoc :foo "bar") => (:keyword {:foo "bar" :param "prev"})
```
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)
(wrap-normalize-env parser plugins)
source

wrap-parallel-setupclj/s

(wrap-parallel-setup parser)
source

wrap-parser-exceptionclj/s

(wrap-parser-exception parser)
source

wrap-reduce-paramsclj/s

(wrap-reduce-params reader)
source

wrap-setup-async-cacheclj/s

(wrap-setup-async-cache parser)
source

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

× close