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

com.wsscode.pathom.connect


addclj/s

(add indexes sym)
(add indexes sym sym-data)

Low level function to add resolvers to the index. This function adds the resolver configuration to the index set, adds the resolver to the ::pc/index-resolvers, add the output to input index in the ::pc/index-oir and the reverse index for auto-complete to the index ::pc/index-io.

This is a low level function, for adding to your index prefer using pc/register.

Low level function to add resolvers to the index. This function adds the resolver
configuration to the index set, adds the resolver to the ::pc/index-resolvers, add
the output to input index in the ::pc/index-oir and the reverse index for auto-complete
to the index ::pc/index-io.

This is a low level function, for adding to your index prefer using `pc/register`.
sourceraw docstring

add-mutationclj/s

(add-mutation indexes
              sym
              {:com.wsscode.pathom.connect/keys [params output] :as data})
source

alias-resolverclj/s

(alias-resolver from to)

Create a resolver that will convert property from to a property to with the same value. This only creates the alias in one direction

Create a resolver that will convert property `from` to a property `to` with
the same value. This only creates the alias in one direction
sourceraw docstring

alias-resolver2clj/s

(alias-resolver2 from to)

Like alias-resolver, but returns a vector containing the alias in both directions.

Like alias-resolver, but returns a vector containing the alias in both directions.
sourceraw docstring

all-async-readersclj/s

source

all-parallel-readersclj/s

source

all-readersclj/s

source

all-values-valid?clj/s

(all-values-valid? m input)
source

as-entry?clj/s

(as-entry? x)
source

async-pick-resolverclj/s

(async-pick-resolver
  {:com.wsscode.pathom.connect/keys [indexes dependency-track] :as env})

DEPRECATED

DEPRECATED
sourceraw docstring

async-readerclj/s

(async-reader {:com.wsscode.pathom.connect/keys [indexes]
               :as env
               :com.wsscode.pathom.core/keys [processing-sequence]})

DEPRECATED: use async-reader2

Like reader, but supports async values on resolver return.

DEPRECATED: use async-reader2

Like reader, but supports async values on resolver return.
sourceraw docstring

async-reader2clj/s

(async-reader2 {:com.wsscode.pathom.connect/keys [indexes max-resolver-weight]
                :or {max-resolver-weight 3600000}
                :as env})

Works in the same way reader2, but supports async values (core.async channels) on resolver return.

Works in the same way `reader2`, but supports async values (core.async channels)
on resolver return.
sourceraw docstring

atom-withclj/s

(atom-with spec)
source

attr-alias-nameclj/s

(attr-alias-name from to)
source

batch-resolverclj/s

(batch-resolver multi-fn)
(batch-resolver single-fn multi-fn)

Return a resolver that will dispatch to single-fn when the input is a single value, and multi-fn when multiple inputs are provided (on batch cases).

Many times the implementation for the single can be the same as the multi, getting the first item, and if you provide only one function (the multi-fn) we will setup the single one automatically running the multi and returning the first result.

Return a resolver that will dispatch to single-fn when the input is a single value, and multi-fn when
multiple inputs are provided (on batch cases).

Many times the implementation for the single can be the same as the multi, getting the first item, and
if you provide only one function (the multi-fn) we will setup the single one automatically running
the multi and returning the first result.
sourceraw docstring

batch-restore-sortclj/s

(batch-restore-sort {:com.wsscode.pathom.connect/keys [inputs key
                                                       batch-default]}
                    items)

Sorts output list to match input list.

When doing batch requests you must return a vector in the same order respective to the order of inputs. Many times when calling an external API sending a list of ids the returned list doesn't always garantee input order. To fix these cases this function can restore the order. Example:

(fn batch-resolver [env inputs]
  ; inputs => [{:my.entity/id 1} {:my.entity/id 2}]
  (batch-restore-sort {::inputs inputs
                       ::key    :my.entity/id}
    [{:my.entity/id    2
      :my.entity/color :my.entity.color/green}
     {:my.entity/id    1
      :my.entity/color :my.entity.color/purple}])
  ; => [{:my.entity/id    1
  ;      :my.entity/color :my.entity.color/purple}
  ;     {:my.entity/id    2
  ;      :my.entity/color :my.entity.color/green}]

You can provide a ::batch-default function to fill in for missing items on the output. The default function will take the respective input and must return a map containing any data you want to add, usually some nil keys to declare that value should not require further lookup.

Sorts output list to match input list.

When doing batch requests you must return a vector in the same order respective to
the order of inputs. Many times when calling an external API sending a list of ids
the returned list doesn't always garantee input order. To fix these cases this
function can restore the order. Example:

    (fn batch-resolver [env inputs]
      ; inputs => [{:my.entity/id 1} {:my.entity/id 2}]
      (batch-restore-sort {::inputs inputs
                           ::key    :my.entity/id}
        [{:my.entity/id    2
          :my.entity/color :my.entity.color/green}
         {:my.entity/id    1
          :my.entity/color :my.entity.color/purple}])
      ; => [{:my.entity/id    1
      ;      :my.entity/color :my.entity.color/purple}
      ;     {:my.entity/id    2
      ;      :my.entity/color :my.entity.color/green}]

You can provide a ::batch-default function to fill in for missing items on the output. The
default function will take the respective input and must return a map containing
any data you want to add, usually some nil keys to declare that value should not
require further lookup.
sourceraw docstring

call-resolverclj/s

(call-resolver {:com.wsscode.pathom.connect/keys [pool-chan] :as env} entity)
source

call-resolver*clj/s

(call-resolver* {:com.wsscode.pathom.connect/keys [resolver-dispatch
                                                   resolver-weights]
                 :or {resolver-dispatch default-resolver-dispatch}
                 :as env}
                entity)
source

compute-pathsclj/s

(compute-paths index-oir keys bad-keys attr)

This function will return a set of possible paths given a set of available keys to reach some attribute. You also send a set of bad keys, bad keys mean information you cannot use (maybe they already got an error, or you known will not be available).

This function will return a set of possible paths given a set of available keys to reach some attribute. You also
send a set of bad keys, bad keys mean information you cannot use (maybe they already got an error, or you known will
not be available).
sourceraw docstring

compute-paths*clj/s

(compute-paths* index-oir keys bad-keys attr pending)
source

connect-pluginclj/s

(connect-plugin)
(connect-plugin {:com.wsscode.pathom.connect/keys [indexes] :as env})

This plugin facilitates the connect setup in a parser. It works by wrapping the parser, it setups the connect resolver and mutation dispatch using the embedded dispatchers (check resolver map format in the book for more details). It also sets up the resolver weights for load balacing calculation. Here are the available options to configure the plugin:

::pc/indexes - provide an index atom to be used, otherwise the plugin will create one ::pc/register - a resolver, mutation or sequence of resolvers/mutations to register in the index ::pc/pool-chan - override the thread pool, use nil to disable thread pool feature (not recommended)

This plugin also looks for the key ::pc/register in the other plugins used in the parser configuration, this enable plugins to provide resolvers/mutations to be available in your connect system.

By default this plugin will also register resolvers to provide the index itself, if you for some reason need to hide it you can dissoc the ::pc/register from the output and they will not be available, but consider that doing so you lose the ability to have introspection tools like Pathom Viz and Fulcro Inspect.

This plugin facilitates the connect setup in a parser. It works by wrapping the parser,
it setups the connect resolver and mutation dispatch using the embedded dispatchers (check resolver
map format in the book for more details). It also sets up the resolver weights for load
balacing calculation. Here are the available options to configure the plugin:

`::pc/indexes` - provide an index atom to be used, otherwise the plugin will create one
`::pc/register` - a resolver, mutation or sequence of resolvers/mutations to register in
the index
`::pc/pool-chan` - override the thread pool, use `nil` to disable thread pool feature (not recommended)

This plugin also looks for the key `::pc/register` in the other plugins used in the
parser configuration, this enable plugins to provide resolvers/mutations to be available
in your connect system.

By default this plugin will also register resolvers to provide the index itself, if
you for some reason need to hide it you can dissoc the `::pc/register` from the output
and they will not be available, but consider that doing so you lose the ability to
have introspection tools like Pathom Viz and Fulcro Inspect.
sourceraw docstring

connect-resolversclj/s

source

constantly-resolverclj/s

(constantly-resolver {:com.wsscode.pathom.connect/keys [attribute sym]
                      :keys [value]})
(constantly-resolver attribute value)

Create a simple resolver that always return value for attribute.

Create a simple resolver that always return `value` for `attribute`.
sourceraw docstring

create-thread-poolclj

(create-thread-pool ch)
(create-thread-pool thread-count ch)

Returns a channel that will enqueue and execute messages using a thread pool.

The returned channel here can be used as the ::pc/pool-chan argument to be used for executing resolvers (and avoid blocking the limited go block threads).

You must provide the channel ch that will be used to listen for commands. You may provide a thread-count, if you do a fixed size thread will be created and shared across all calls to the parser. In case you don't provide the thread-count the threads will be managed by core.async built-in thread pool for threads (not the same as the go block threads).

Returns a channel that will enqueue and execute messages using a thread pool.

The returned channel here can be used as the ::pc/pool-chan argument to be used
for executing resolvers (and avoid blocking the limited go block threads).

You must provide the channel ch that will be used to listen for commands.
You may provide a thread-count, if you do a fixed size thread will be created
and shared across all calls to the parser. In case you don't provide the
thread-count the threads will be managed by core.async built-in thread pool
for threads (not the same as the go block threads).
sourceraw docstring

data->shapeclj/s

(data->shape data)

Helper function to transform a data into an output shape.

Helper function to transform a data into an output shape.
sourceraw docstring

decrease-path-costsclj/s

(decrease-path-costs {:com.wsscode.pathom.connect/keys
                        [resolver-weights resolver-weight-decrease-amount]
                      :or {resolver-weight-decrease-amount 1}}
                     plan)
source

default-resolver-dispatchclj/s

(default-resolver-dispatch _env _entity)
source

default-sort-planclj/s

(default-sort-plan env plan)
source

defmutationclj/smacro

(defmutation sym arglist config & body)
source

defresolverclj/smacro

(defresolver name docstring? arglist options? & body)

Defines a new Pathom resolver.

Resolvers are the central abstraction around Pathom, a resolver is a function that contains some annotated information and follow a few rules:

  1. The resolver input must be a map, so the input information is labelled.
  2. A resolver must return a map, so the output information is labelled.
  3. A resolver also receives a separated map containing the environment information.

Here are some examples of how you can use the defresolver syntax to define resolvers:

The verbose example:

(pc/defresolver song-by-id [env {:acme.song/keys [id]}]
  {::pc/input     #{:acme.song/id}
   ::pc/output    [:acme.song/title :acme.song/duration :acme.song/tone]
   ::pc/params    []
   ::pc/transform identity}
  (fetch-song env id))

The previous example demonstrates the usage of the most common options in defresolver.

But we don't need to write all of that, for example, instead of manually saying the ::pc/input, we can let the defresolver infer it from the param destructuring, so the following code works the same (::pc/params and ::pc/transform also removed, since they were no-ops in this example):

(pc/defresolver song-by-id [env {:acme.song/keys [id]}]
  {::pc/output [:acme.song/title :acme.song/duration :acme.song/tone]}
  (fetch-song env id))

This makes for a cleaner write, now lets use this format and write a new example resolver:

(pc/defresolver full-name [env {:acme.user/keys [first-name last-name]}]
  {::pc/output [:acme.user/full-name]}
  {:acme.user/full-name (str first-name " " last-name)})

The first thing we see is that we don't use env, so we can omit it.

(pc/defresolver full-name [{:acme.user/keys [first-name last-name]}]
  {::pc/output [:acme.user/full-name]}
  {:acme.user/full-name (str first-name " " last-name)})

Also, when the last expression of the defresolver is a map, it will infer the output shape from it:

(pc/defresolver full-name [{:acme.user/keys [first-name last-name]}]
  {:acme.user/full-name (str first-name " " last-name)})

You can always override the implicit input and output by setting on the configuration map.

Standard options:

::pc/output - description of resolver output, in EQL format ::pc/input - description of resolver input, as a set ::pc/params - description of resolver parameters, in EQL format ::pc/transform - a function to transform the resolver configuration before instantiating the resolver

Note that any other option that you send to the resolver config will be stored in the index and can be read from it at any time.

Defines a new Pathom resolver.

Resolvers are the central abstraction around Pathom, a resolver is a function
that contains some annotated information and follow a few rules:

1. The resolver input must be a map, so the input information is labelled.
2. A resolver must return a map, so the output information is labelled.
3. A resolver also receives a separated map containing the environment information.

Here are some examples of how you can use the defresolver syntax to define resolvers:

The verbose example:

    (pc/defresolver song-by-id [env {:acme.song/keys [id]}]
      {::pc/input     #{:acme.song/id}
       ::pc/output    [:acme.song/title :acme.song/duration :acme.song/tone]
       ::pc/params    []
       ::pc/transform identity}
      (fetch-song env id))

The previous example demonstrates the usage of the most common options in defresolver.

But we don't need to write all of that, for example, instead of manually saying
the ::pc/input, we can let the defresolver infer it from the param destructuring, so
the following code works the same (::pc/params and ::pc/transform also removed, since
they were no-ops in this example):

    (pc/defresolver song-by-id [env {:acme.song/keys [id]}]
      {::pc/output [:acme.song/title :acme.song/duration :acme.song/tone]}
      (fetch-song env id))

This makes for a cleaner write, now lets use this format and write a new example
resolver:

    (pc/defresolver full-name [env {:acme.user/keys [first-name last-name]}]
      {::pc/output [:acme.user/full-name]}
      {:acme.user/full-name (str first-name " " last-name)})

The first thing we see is that we don't use env, so we can omit it.

    (pc/defresolver full-name [{:acme.user/keys [first-name last-name]}]
      {::pc/output [:acme.user/full-name]}
      {:acme.user/full-name (str first-name " " last-name)})

Also, when the last expression of the defresolver is a map, it will infer the output
shape from it:

    (pc/defresolver full-name [{:acme.user/keys [first-name last-name]}]
      {:acme.user/full-name (str first-name " " last-name)})

You can always override the implicit input and output by setting on the configuration
map.

Standard options:

  ::pc/output - description of resolver output, in EQL format
  ::pc/input - description of resolver input, as a set
  ::pc/params - description of resolver parameters, in EQL format
  ::pc/transform - a function to transform the resolver configuration before instantiating the resolver

Note that any other option that you send to the resolver config will be stored in the
index and can be read from it at any time.
sourceraw docstring

discover-attrsclj/s

(discover-attrs {:com.wsscode.pathom.connect/keys [index-io cache] :as index}
                ctx)
source

extract-destructure-map-keys-as-keywordsclj/s

(extract-destructure-map-keys-as-keywords m)
source

full-symbolclj/s

(full-symbol sym ns)
source

group-input-indexesclj/s

(group-input-indexes inputs)
source

ident-readerclj/s

(ident-reader env)

Reader for idents on connect, this reader will make a join to the ident making the context have that ident key and value. For example the ident [:user/id 123] will make a join to a context {:user/id 123}. This reader will continue if connect doesn't have a path to respond to that ident.

This reader also supports params to add more context besides the entity value. To use that send the :pathom/context param with the join, as in:

[{([:user/id 123] {:pathom/context {:user/foo "bar"}}) [:user/name]}]

In the previous case, the context will be the merge between the identity and the context, {:user/id 123 :user/foo "bar"} in this case.

Reader for idents on connect, this reader will make a join to the ident making the
context have that ident key and value. For example the ident [:user/id 123] will make
a join to a context {:user/id 123}. This reader will continue if connect doesn't have
a path to respond to that ident.

This reader also supports params to add more context besides the entity value. To use
that send the `:pathom/context` param with the join, as in:

[{([:user/id 123] {:pathom/context {:user/foo "bar"}})
  [:user/name]}]

In the previous case, the context will be the merge between the identity and the
context, {:user/id 123 :user/foo "bar"} in this case.
sourceraw docstring

index-attributesclj/s

(index-attributes {:com.wsscode.pathom.connect/keys [sym input output]})
source

index-explorer-resolverclj/s

source

index-mergerclj/smultimethod

This is an extensible gateway so you can define different strategies for merging different kinds of indexes.

This is an extensible gateway so you can define different strategies for merging different
kinds of indexes.
sourceraw docstring

index-readerclj/s

source

indexed-identclj/s

(indexed-ident {:com.wsscode.pathom.connect/keys [indexes] :as env})
source

indexes-resolverclj/s

source

merge-growclj/s

(merge-grow a b)
source

merge-indexesclj/s

(merge-indexes ia ib)
source

merge-ioclj/s

source

merge-io-attrsclj/s

source

merge-oirclj/s

source

mutateclj/s

(mutate {:com.wsscode.pathom.connect/keys [indexes mutate-dispatch
                                           mutation-join-globals]
         :keys [query ast]
         :or {mutation-join-globals []}
         :as env}
        sym'
        {:keys [pathom/context] :as input})

Sync mutate function to integrate connect mutations to pathom parser.

Sync mutate function to integrate connect mutations to pathom parser.
sourceraw docstring

mutate-asyncclj/s

(mutate-async {:com.wsscode.pathom.connect/keys [indexes mutate-dispatch
                                                 mutation-join-globals]
               :keys [query ast]
               :or {mutation-join-globals []}
               :as env}
              sym'
              {:keys [pathom/context] :as input})

Async mutate function to integrate connect mutations to pathom parser.

Async mutate function to integrate connect mutations to pathom parser.
sourceraw docstring

mutationclj/s

(mutation sym {:com.wsscode.pathom.connect/keys [transform] :as options} mutate)

Helper to return a mutation map

Helper to return a mutation map
sourceraw docstring

mutation-dataclj/s

(mutation-data env-or-indexes sym)

Get mutation map information in env from the resolver sym.

Get mutation map information in env from the resolver sym.
sourceraw docstring

mutation-dispatchclj/s

(mutation-dispatch env _)

Helper method that extract key from ast symbol from env. It's recommended to use as a dispatch method for creating multi-methods for mutation dispatch.

Helper method that extract key from ast symbol from env. It's recommended to use as a dispatch method for creating
multi-methods for mutation dispatch.
sourceraw docstring

mutation-dispatch-embeddedclj/s

(mutation-dispatch-embedded {:com.wsscode.pathom.connect/keys [indexes] :as env}
                            entity)

This dispatch method will fire the mutation by looking at the ::pc/mutate key in the mutation map details.

This dispatch method will fire the mutation by looking at the ::pc/mutate
key in the mutation map details.
sourceraw docstring

mutation-factoryclj/s

(mutation-factory mm idx)
source

normalize-arglistclj/s

(normalize-arglist arglist)

Ensures arglist contains two elements.

Ensures arglist contains two elements.
sourceraw docstring

normalize-ioclj/s

source

normalized-childrenclj/s

(normalized-children {:keys [children]})
source

open-ident-readerclj/s

(open-ident-reader env)

Like ident-reader, but ident key doesn't have to be in the index, this will respond to any ident join. Also supports extra context with :pathom/context param.

Like ident-reader, but ident key doesn't have to be in the index, this will respond
to any ident join. Also supports extra context with :pathom/context param.
sourceraw docstring

optimize-empty-joinsclj/s

(optimize-empty-joins x)
source

output->providesclj/s

(output->provides output)
source

output-providesclj/s

(output-provides query)
source

output-provides*clj/s

(output-provides* {:keys [key children]})
source

parallel-batchclj/s

(parallel-batch {:com.wsscode.pathom.core/keys [processing-sequence path
                                                entity-path-cache]
                 :as env})
source

parallel-batch-errorclj/s

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

parallel-readerclj/s

(parallel-reader {:com.wsscode.pathom.connect/keys [indexes max-resolver-weight]
                  :com.wsscode.pathom.core/keys [processing-sequence]
                  :com.wsscode.pathom.parser/keys [waiting]
                  :or {max-resolver-weight 3600000}
                  :as env})
source

params->resolver-optionsclj/s

(params->resolver-options {:keys [arglist options body docstring]})
source

path-costclj/s

(path-cost {:com.wsscode.pathom.connect/keys [resolver-weights]
            :com.wsscode.pathom.core/keys [request-cache]
            :as env}
           path)
source

pick-resolverclj/s

(pick-resolver {:com.wsscode.pathom.connect/keys [indexes dependency-track]
                :as env})

DEPRECATED

DEPRECATED
sourceraw docstring

plan->providesclj/s

(plan->provides env plan)
source

plan->resolversclj/s

(plan->resolvers plan)
source

project-parent-query-attributesclj/s

(project-parent-query-attributes {:com.wsscode.pathom.core/keys [parent-query]
                                  :as env})

Project query attributes for the parent query. See

Project query attributes for the parent query. See
sourceraw docstring

project-query-attributesclj/s

(project-query-attributes env query)

Returns a set containing all attributes that are expected to participate in path resolution given a query. This function is intended to help dynamic resolvers that need to know which attributes are required before doing a call to the information source. For example, we never want to issue more than one GraphQL query to the same server at the same query level, but if we just look at the parent query is not enough; that's because some of the attributes might require other attributes to be fetched, this function will scan the attributes and figure everything that is required so you can issue a single request.

Please note the attribute calculation might depend on the data currently available in the ::p/entity, if you are calculating attributes for a different context you might want to replace some of the entity data.

This function is intended to be called during resolver code.

Returns a set containing all attributes that are expected to participate in path
resolution given a query. This function is intended to help dynamic
resolvers that need to know which attributes are required before doing a call to the
information source. For example, we never want to issue more than one GraphQL query
to the same server at the same query level, but if we just look at the parent query
is not enough; that's because some of the attributes might require other attributes
to be fetched, this function will scan the attributes and figure everything that is
required so you can issue a single request.

Please note the attribute calculation might depend on the data currently available
in the `::p/entity`, if you are calculating attributes for a different context
you might want to replace some of the entity data.

This function is intended to be called during resolver code.
sourceraw docstring

readerclj/s

(reader {:com.wsscode.pathom.connect/keys [indexes]
         :as env
         :com.wsscode.pathom.core/keys [processing-sequence]})

DEPRECATED: use reader2 instead

Connect reader, this reader will lookup the given key in the index to process it, in case the resolver input can't be satisfied it will do a recursive lookup trying to find the next input.

I recommend you switch to reader2, which instead plans ahead of time the full path it will need to cover to go from the current data to the requested attribute.

DEPRECATED: use reader2 instead

Connect reader, this reader will lookup the given key in the index
to process it, in case the resolver input can't be satisfied it will
do a recursive lookup trying to find the next input.

I recommend you switch to reader2, which instead plans ahead of time
the full path it will need to cover to go from the current data to
the requested attribute.
sourceraw docstring

reader-compute-planclj/s

(reader-compute-plan env failed-resolvers)
source

reader2clj/s

(reader2 {:com.wsscode.pathom.connect/keys [indexes max-resolver-weight]
          :com.wsscode.pathom.core/keys [processing-sequence]
          :or {max-resolver-weight 3600000}
          :as env})

Recommended reader to use with Pathom serial parser.

This reader uses the connect index to compute a EQL property requirement.

The process goes as:

  • find possible paths to realize the attribute, given the current available data, generating a plan
  • executes the plan
  • in case a resolver fails (due to exception, or missing required data) the reader will try to backtrack and execute another path (if there is one available).

This only handles sync process, if you return a core.async channel, the channel itself will be the response. If you need to handle async use async-reader2.

Recommended reader to use with Pathom serial parser.

This reader uses the connect index to compute a EQL property requirement.

The process goes as:

- find possible paths to realize the attribute, given the current available data, generating a plan
- executes the plan
- in case a resolver fails (due to exception, or missing required data) the reader will
  try to backtrack and execute another path (if there is one available).

This only handles sync process, if you return a core.async channel, the channel itself
will be the response. If you need to handle async use `async-reader2`.
sourceraw docstring

reader3clj/s

(reader3 {:com.wsscode.pathom.connect/keys [indexes reader3-computed-plans]
          :com.wsscode.pathom.core/keys [async-parser?]
          :as env})

EXPERIMENTAL

I created this reader here to experiment with a new way of planning. Since then the code was ported and evolving in Pathom 3, this reader will get no further upgrades in Pathom 2.

EXPERIMENTAL

I created this reader here to experiment with a new way of planning. Since then the
code was ported and evolving in Pathom 3, this reader will get no further upgrades
in Pathom 2.
sourceraw docstring

reader3-all-requires-ready?clj/s

(reader3-all-requires-ready? env
                             {:com.wsscode.pathom.connect.planner/keys
                                [requires]})
source

reader3-compute-run-graphclj/s

(reader3-compute-run-graph env)
source

reader3-merge-resolver-responseclj/s

(reader3-merge-resolver-response env sym response)
source

reader3-node-log!clj/s

(reader3-node-log! {:com.wsscode.pathom.connect/keys [run-plan*] :as env}
                   {:com.wsscode.pathom.connect.planner/keys [node-id]}
                   event)
source

reader3-prepare-astclj/s

(reader3-prepare-ast {:com.wsscode.pathom.core/keys [parent-query] :as env})

Prepare AST from parent query. This will lift placeholder nodes, convert query to AST and remove children keys that are already present in the current entity.

Prepare AST from parent query. This will lift placeholder nodes, convert
query to AST and remove children keys that are already present in the current
entity.
sourceraw docstring

reader3-report-invalid-responseclj/s

(reader3-report-invalid-response env sym response)
source

reader3-run-and-nodeclj/s

(reader3-run-and-node env plan node)

Execute an AND node.

Execute an AND node.
sourceraw docstring

reader3-run-and-node-asyncclj/s

(reader3-run-and-node-async env
                            plan
                            {:com.wsscode.pathom.connect.planner/keys [run-and]
                             :as node})
source

reader3-run-and-node-syncclj/s

(reader3-run-and-node-sync env
                           plan
                           {:com.wsscode.pathom.connect.planner/keys [run-and]
                            :as node})
source

reader3-run-next-nodeclj/s

(reader3-run-next-node env
                       plan
                       {:com.wsscode.pathom.connect.planner/keys [run-next]})
source

reader3-run-nodeclj/s

(reader3-run-node env plan node)
source

reader3-run-or-nodeclj/s

(reader3-run-or-node env plan node)

Execute an OR node.

Execute an OR node.
sourceraw docstring

reader3-run-or-node-asyncclj/s

(reader3-run-or-node-async env
                           plan
                           {:com.wsscode.pathom.connect.planner/keys [run-or]
                            :as or-node})
source

reader3-run-or-node-syncclj/s

(reader3-run-or-node-sync env
                          plan
                          {:com.wsscode.pathom.connect.planner/keys [run-or]
                           :as or-node})
source

reader3-run-resolver-nodeclj/s

(reader3-run-resolver-node {:com.wsscode.pathom.connect/keys [indexes]
                            :com.wsscode.pathom.core/keys [async-parser?]
                            :as env}
                           plan
                           {:com.wsscode.pathom.connect/keys [sym]
                            :com.wsscode.pathom.connect.planner/keys [input
                                                                      params]
                            :as node})

Call a run graph node resolver and execute it.

Call a run graph node resolver and execute it.
sourceraw docstring

registerclj/s

(register indexes item-or-items)

Updates the index by registering the given resolver or mutation (lets call it item), an item can be:

  1. a resolver map
  2. a mutation map
  3. a sequence with items

The sequence version can have nested sequences, they will be recursively add.

Examples of possible usages:

(-> {} ; blank index
    (pc/register one-resolver) ; single resolver
    (pc/register one-mutation) ; single mutation
    (pc/register [one-resolver one-mutation]) ; sequence of resolvers/mutations
    (pc/register [[resolver1 resolver2] [resolver3 mutation]]) ; nested sequences
    (pc/register [[resolver1 resolver2] resolver-out [resolver3 mutation]]) ; all mixed
    )
Updates the index by registering the given resolver or mutation (lets call it item),
an item can be:

1. a resolver map
2. a mutation map
3. a sequence with items

The sequence version can have nested sequences, they will be recursively add.

Examples of possible usages:

    (-> {} ; blank index
        (pc/register one-resolver) ; single resolver
        (pc/register one-mutation) ; single mutation
        (pc/register [one-resolver one-mutation]) ; sequence of resolvers/mutations
        (pc/register [[resolver1 resolver2] [resolver3 mutation]]) ; nested sequences
        (pc/register [[resolver1 resolver2] resolver-out [resolver3 mutation]]) ; all mixed
        )
sourceraw docstring

reprocess-indexclj/s

(reprocess-index {:com.wsscode.pathom.connect/keys [index-resolvers]})

This will use the ::index-resolvers to re-build the index. You might need that if in development you changed some definitions and got in a dirty state somehow

This will use the ::index-resolvers to re-build the index. You might need that if in development you changed some definitions
and got in a dirty state somehow
sourceraw docstring

resolve-planclj/s

(resolve-plan {:com.wsscode.pathom.connect/keys [indexes sort-plan] :as env})
source

resolverclj/s

(resolver sym
          {:com.wsscode.pathom.connect/keys [transform] :as options}
          resolve)

Helper to return a resolver map

Helper to return a resolver map
sourceraw docstring

resolver->outputclj/s

(resolver->output env resolver-sym)
source

resolver-dataclj/s

source

resolver-dispatchclj/s

(resolver-dispatch env)
(resolver-dispatch env _)

Helper method that extract resolver symbol from env. It's recommended to use as a dispatch method for creating multi-methods for resolver dispatch.

Helper method that extract resolver symbol from env. It's recommended to use as a dispatch method for creating
multi-methods for resolver dispatch.
sourceraw docstring

resolver-dispatch-embeddedclj/s

(resolver-dispatch-embedded {{:com.wsscode.pathom.connect/keys [resolve sym]}
                               :com.wsscode.pathom.connect/resolver-data
                             :as env}
                            entity)

This dispatch method will fire the resolver by looking at the ::pc/resolve key in the resolver map details.

This dispatch method will fire the resolver by looking at the ::pc/resolve
key in the resolver map details.
sourceraw docstring

resolver-factoryclj/s

(resolver-factory mm idx)

Given multi-method mm and index atom idx, returns a function with the given signature: [sym config f], the function will be add to the mm and will be indexed using config as the config params for connect/add.

Given multi-method mm and index atom idx, returns a function with the given signature:
[sym config f], the function will be add to the mm and will be indexed using config as
the config params for connect/add.
sourceraw docstring

resolver-weights-resolverclj/s

source

resolver-weights-resolversclj/s

source

resolver-weights-sorted-resolverclj/s

source

serial-cache-resolver-callclj/s

(serial-cache-resolver-call {:com.wsscode.pathom.core/keys [processing-sequence]
                             {:com.wsscode.pathom.connect/keys [sym batch?]}
                               :com.wsscode.pathom.connect/resolver-data
                             :as env}
                            e)
source

serial-resolver-call-batchclj/s

(serial-resolver-call-batch {:com.wsscode.pathom.core/keys [processing-sequence]
                             {:com.wsscode.pathom.connect/keys [sym input]}
                               :com.wsscode.pathom.connect/resolver-data
                             :as env}
                            e)
source

single-attr-resolverclj/s

(single-attr-resolver from to f)

Apply fn f to input from and spits the result with the name to.

f receives a single argument, which is the input value from from.

Apply fn `f` to input `from` and spits the result with the name `to`.

`f` receives a single argument, which is the input value from `from`.
sourceraw docstring

single-attr-resolver2clj/s

(single-attr-resolver2 from to f)

Similar single-attr-resolver, but f receives two arguments, env and the input.

Similar single-attr-resolver, but `f` receives two arguments, `env` and the input.
sourceraw docstring

sort-resolversclj/s

(sort-resolvers {:com.wsscode.pathom.core/keys [request-cache]} resolvers e)
source

split-good-bad-keysclj/s

(split-good-bad-keys entity)
source

step-weightclj/s

(step-weight value new-value)
source

transform-auto-batchclj/s

(transform-auto-batch n)

Given a resolver that implements the single item case, wrap it implementing a batch resolver that will make a batch by running many in parallel, using n as the concurrency number.

Given a resolver that implements the single item case, wrap it implementing a batch
resolver that will make a batch by running many in parallel, using `n` as the concurrency
number.
sourceraw docstring

transform-batch-resolverclj/s

(transform-batch-resolver resolver)

Given a resolver that implements the many case, return one that also supports the single case by running the many and taking the first result out.

Given a resolver that implements the many case, return one that also supports the
single case by running the many and taking the first result out.
sourceraw docstring

update-resolver-weightclj/s

(update-resolver-weight {:com.wsscode.pathom.connect/keys [resolver-weights]}
                        resolver
                        &
                        args)
source

valid-eql-key?clj/s

(valid-eql-key? k)
source

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

× close