Liking cljdoc? Tell your friends :D
All platforms.

com.wsscode.pathom.connect.planner


add-after-nodeclj/s

(add-after-node graph node-id after-node-id)
source

add-branch-nodeclj/s

(add-branch-node {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
                 {:com.wsscode.pathom.connect.planner/keys [branch-type]
                  :as env}
                 {:com.wsscode.pathom.connect.planner/keys [node-id]})

Given a branch node is the root, this function will add the new node as part of that branch node. If the node is a repeating dynamic node it will cause the new node to be collapsed into the already existent dynamic node.

Given a branch node is the root, this function will add the new node as part
of that branch node. If the node is a repeating dynamic node it will cause the new node
to be collapsed into the already existent dynamic node.
sourceraw docstring

add-node-logclj/s

(add-node-log graph node-id event)

Add a new log entry to the node, this is similar to how tracing works, but these are internal logs about events for that specific node.

Add a new log entry to the node, this is similar to how tracing works, but these are
internal logs about events for that specific node.
sourceraw docstring

add-unreachable-attrclj/s

(add-unreachable-attr graph attr)

Add attribute to unreachable list

Add attribute to unreachable list
sourceraw docstring

add-warningclj/s

(add-warning graph warn)
source

all-attribute-resolversclj/s

(all-attribute-resolvers {:com.wsscode.pathom.connect/keys [index-oir]} attr)
source

all-node-idsclj/s

(all-node-ids graph)

Return all node-ids from the graph.

Return all node-ids from the graph.
sourceraw docstring

assoc-nodeclj/s

(assoc-node graph node-id k v)

Set property k about node-id. Only assoc when node exists, otherwise its a noop.

Set property k about node-id. Only assoc when node exists, otherwise its a noop.
sourceraw docstring

ast-nodeclj/s

source

base-envclj/s

(base-env)
source

base-graphclj/s

(base-graph)
source

branch-add-and-nodeclj/s

(branch-add-and-node graph branch-node-id node-id)
source

branch-node?clj/s

(branch-node? node)
source

can-merge-and-nodes?clj/s

(can-merge-and-nodes? n1 n2)
source

collapse-and-nodesclj/s

(collapse-and-nodes graph target-node-id node-id)

Collapse AND node next-node into AND node target-node-id.

Collapse AND node next-node into AND node target-node-id.
sourceraw docstring

collapse-dynamic-nodesclj/s

(collapse-dynamic-nodes graph env target-node-id node-id)
source

collapse-nodes-branchclj/s

(collapse-nodes-branch graph env target-node-id node-id)
source

collapse-nodes-chainclj/s

(collapse-nodes-chain graph target-node-id node-id)

Merge chained nodes:

A -> B

A is target node, B is the node, this collapses things and only A will exist after.

Merge chained nodes:

A -> B

A is target node, B is the node, this collapses things and only A will exist after.
sourceraw docstring

collapse-set-node-run-nextclj/s

(collapse-set-node-run-next graph target-node-id run-next)

Like set-node-run-next, but also checks if the target and next node are the same resolver, if so, this fn will collapse those nodes.

Like set-node-run-next, but also checks if the target and next node are the same
resolver, if so, this fn will collapse those nodes.
sourceraw docstring

collect-symsclj/s

(collect-syms graph env node)
(collect-syms graph
              env
              {:com.wsscode.pathom.connect.planner/keys [node-id]}
              syms)
source

compute-all-node-depthsclj/s

(compute-all-node-depths graph)

Return graph with node-depth calculated for all nodes.

Return graph with node-depth calculated for all nodes.
sourceraw docstring

compute-attribute-graphclj/s

(compute-attribute-graph
  {:com.wsscode.pathom.connect.planner/keys [unreachable-attrs] :as graph}
  {:com.wsscode.pathom.connect.planner/keys [available-data attr-deps-trail]
   :com.wsscode.pathom.connect/keys [index-oir]
   {attr :key} :edn-query-language.ast/node
   :as env})

Compute the run graph for a given attribute.

Compute the run graph for a given attribute.
sourceraw docstring

compute-attribute-graph*clj/s

(compute-attribute-graph*
  {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
  {:com.wsscode.pathom.connect/keys [index-oir attribute] :as env})
source

compute-branch-node-chain-depthclj/s

(compute-branch-node-chain-depth graph node-id)
source

compute-input-resolvers-graphclj/s

(compute-input-resolvers-graph
  graph
  {:com.wsscode.pathom.connect.planner/keys [available-data] :as env}
  inputs
  resolvers)
source

compute-missing-chainclj/s

(compute-missing-chain graph
                       {:com.wsscode.pathom.connect.planner/keys
                          [graph-before-missing-chain]
                        :as env}
                       missing)

Start a recursive call to process the dependencies required by the resolver. It sets the ::run-next data at the env, it will be used to link the nodes after they are created in the process.

Start a recursive call to process the dependencies required by the resolver. It
sets the ::run-next data at the env, it will be used to link the nodes after they
are created in the process.
sourceraw docstring

compute-nested-node-detailsclj/s

(compute-nested-node-details {ast :edn-query-language.ast/node :as env})

Use AST children nodes and resolver provides data to compute the nested requirements for dynamic nodes.

Use AST children nodes and resolver provides data to compute the nested requirements
for dynamic nodes.
sourceraw docstring

compute-node-chain-depthclj/s

(compute-node-chain-depth graph node-id)
source

compute-node-depthclj/s

(compute-node-depth graph node-id)

Calculate depth of node-id, this returns a graph in which that node has the key ::node-depth associated in the node. The depth is calculated by following the ::after-nodes chain, in the process all the parent node depths are also calculated and set, this makes it efficient to scan the list calculating the depths, given each node will be visited at max once.

Calculate depth of node-id, this returns a graph in which that node has
the key ::node-depth associated in the node. The depth is calculated by
following the ::after-nodes chain, in the process all the parent node depths
are also calculated and set, this makes it efficient to scan the list calculating
the depths, given each node will be visited at max once.
sourceraw docstring

compute-resolver-graphclj/s

(compute-resolver-graph
  {:com.wsscode.pathom.connect.planner/keys [unreachable-syms] :as graph}
  env
  resolver)
source

compute-root-andclj/s

(compute-root-and {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
                  env
                  {:com.wsscode.pathom.connect.planner/keys [node-id] :as node})
source

compute-root-branchclj/s

(compute-root-branch {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
                     {:com.wsscode.pathom.connect.planner/keys [branch-type]
                      :as env}
                     {:com.wsscode.pathom.connect.planner/keys [node-id]}
                     branch-node-factory)
source

compute-root-orclj/s

(compute-root-or {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
                 {:com.wsscode.pathom.connect/keys [attribute] :as env}
                 {:com.wsscode.pathom.connect.planner/keys [node-id] :as node})
source

compute-run-graphclj/s

(compute-run-graph env)
(compute-run-graph graph env)

Generates a run plan for a given environment, the environment should contain the indexes in it (::pc/index-oir and ::pc/index-resolvers). It computes a plan to execute one level of an AST, the AST must be provided via the key :edn-query-language.ast/node.

 (compute-run-graph (assoc indexes :edn-query-language.ast/node ...))

The resulting graph will look like this:

::nodes {1 {::node-id 1}}

Generates a run plan for a given environment, the environment should contain the
indexes in it (::pc/index-oir and ::pc/index-resolvers). It computes a plan to execute
one level of an AST, the AST must be provided via the key :edn-query-language.ast/node.

     (compute-run-graph (assoc indexes :edn-query-language.ast/node ...))

The resulting graph will look like this:

  ::nodes {1 {::node-id 1}}
sourceraw docstring

compute-run-graph*clj/s

(compute-run-graph* graph env)
source

create-branch-nodeclj/s

(create-branch-node {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
                    env
                    node
                    branch-node)
source

create-resolver-nodeclj/s

(create-resolver-node graph
                      {:com.wsscode.pathom.connect.planner/keys [run-next input
                                                                 source-sym]
                       :com.wsscode.pathom.connect/keys [attribute sym]
                       ast :edn-query-language.ast/node
                       :as env})

Create a new node representative to run a given resolver.

Create a new node representative to run a given resolver.
sourceraw docstring

direct-node-successorsclj/s

(direct-node-successors {:com.wsscode.pathom.connect.planner/keys [run-next]
                         :as node})

Direct successors of node, branch nodes and run-next, in case of branch nodes the branches will always come before the run-next.

Direct successors of node, branch nodes and run-next, in case of branch nodes the
branches will always come before the run-next.
sourceraw docstring

dynamic-base-provider-symclj/s

source

dynamic-resolver?clj/s

(dynamic-resolver? {:com.wsscode.pathom.connect/keys [index-resolvers]} sym)
source

find-attribute-resolver-in-successorsclj/s

(find-attribute-resolver-in-successors graph node-id attribute)

Find the nodes that get the data required for the require in the OR node.

Find the nodes that get the data required for the require in the OR node.
sourceraw docstring

find-branch-node-to-mergeclj/s

(find-branch-node-to-merge
  {:com.wsscode.pathom.connect.planner/keys [root] :as graph}
  {:com.wsscode.pathom.connect.planner/keys [branch-type]}
  {:com.wsscode.pathom.connect.planner/keys [node-id]})

Given some branch node, tries to find a node with a dynamic resolver that's the same sym as the node in node-id.

Given some branch node, tries to find a node with a dynamic resolver that's the
same sym as the node in node-id.
sourceraw docstring

find-first-ancestorclj/s

(find-first-ancestor graph node-id)

Traverse node after-node chain and returns the most distant resolver ancestor node id. This only walks though resolver nodes, branch nodes are removed.

Traverse node after-node chain and returns the most distant resolver ancestor node id.
This only walks though resolver nodes, branch nodes are removed.
sourceraw docstring

find-missing-ancestorclj/s

(find-missing-ancestor graph missing)

Find the first common AND node ancestors from missing list, missing is a list of attributes

Find the first common AND node ancestors from missing list, missing is a list
of attributes
sourceraw docstring

first-common-ancestorclj/s

(first-common-ancestor graph node-ids)

Find first common node ancestor given a list of node ids.

Find first common node ancestor given a list of node ids.
sourceraw docstring

get-attribute-nodeclj/s

(get-attribute-node graph attribute)

Find the node for attribute in attribute index.

Find the node for attribute in attribute index.
sourceraw docstring

get-nodeclj/s

(get-node graph node-id)
(get-node graph node-id k)
source

get-root-nodeclj/s

(get-root-node {:com.wsscode.pathom.connect.planner/keys [root] :as graph})
source

graph-providesclj/s

(graph-provides {:com.wsscode.pathom.connect.planner/keys [index-attrs]})

Get a set with all provided attributes from the graph.

Get a set with all provided attributes from the graph.
sourceraw docstring

include-nodeclj/s

(include-node graph
              _env
              {:com.wsscode.pathom.connect.planner/keys [node-id] :as node})
source

inject-index-nested-providesclj/s

(inject-index-nested-provides indexes
                              {:com.wsscode.pathom.connect/keys [attribute sym]
                               :as env})
source

integrate-node-logclj/s

(integrate-node-log {:com.wsscode.pathom.connect.planner/keys [node-trace]
                     :as node})

Pulls the events from ::node-trace to the node itself, this will use the name from ::pt/event on each trace event and make it part of the node itself.

Note that in case of repeated events, only the last one will be kept.

Pulls the events from ::node-trace to the node itself, this will use the name from
::pt/event on each trace event and make it part of the node itself.

Note that in case of repeated events, only the last one will be kept.
sourceraw docstring

mark-node-unreachableclj/s

(mark-node-unreachable previous-graph
                       graph
                       {:com.wsscode.pathom.connect.planner/keys
                          [unreachable-syms unreachable-attrs]}
                       env)
source

merge-node-inputclj/s

(merge-node-input graph
                  target-node-id
                  {:com.wsscode.pathom.connect.planner/keys [input]})

Merge input from node into target-node-id.

Merge input from node into target-node-id.
sourceraw docstring

merge-node-requiresclj/s

(merge-node-requires graph
                     target-node-id
                     {:com.wsscode.pathom.connect.planner/keys [requires]})

Merge requires from node into target-node-id.

Merge requires from node into target-node-id.
sourceraw docstring

merge-nodes-foreign-astclj/s

(merge-nodes-foreign-ast graph
                         target-node-id
                         {:com.wsscode.pathom.connect.planner/keys
                            [foreign-ast]})

Merge the foreign-ast from two dynamic nodes, the operations adds each children from node into foreign-ast of the target node. This uses the requires to detect if some property is already on the query, so this must be called before merging requires to get the correct behavior.

Merge the foreign-ast from two dynamic nodes, the operations adds each children from
node into foreign-ast of the target node. This uses the requires to detect if some
property is already on the query, so this must be called before merging requires to
get the correct behavior.
sourceraw docstring

merge-nodes-paramsclj/s

(merge-nodes-params graph
                    target-node-id
                    {:com.wsscode.pathom.connect.planner/keys [params]})

Merge params of nodes, in case of conflicting keys a warning will be generated.

Merge params of nodes, in case of conflicting keys a warning will be generated.
sourceraw docstring

merge-nodes-run-nextclj/s

(merge-nodes-run-next {:com.wsscode.pathom.connect.planner/keys [root]
                       :as graph}
                      env
                      target-node-id
                      {:com.wsscode.pathom.connect.planner/keys [run-next]})

Updates target-node-id run-next with the run-next of the last argument. This will do an AND branch operation with node-id run-next and run-next, updating the reference of node-id run-next.

Updates target-node-id run-next with the run-next of the last argument. This will do an AND
branch operation with node-id run-next and run-next, updating the reference of node-id
run-next.
sourceraw docstring

next-node-idclj/s

(next-node-id {:com.wsscode.pathom.connect.planner/keys [id-counter]})

Return the next node ID in the system, its an incremental number

Return the next node ID in the system, its an incremental number
sourceraw docstring

node->labelclj/s

(node->label node)

Return a string representation for the node, for resolver nodes this is the symbol, branch nodes get AND / OR respectively.

Return a string representation for the node, for resolver nodes this is the
symbol, branch nodes get AND / OR respectively.
sourceraw docstring

node-ancestorsclj/s

(node-ancestors graph node-id)

Return all node ancestors. The order of the output will go from closest to farthest nodes, like breathing out of the current node.

Return all node ancestors. The order of the output will go from closest to farthest
nodes, like breathing out of the current node.
sourceraw docstring

node-branchesclj/s

(node-branches node)
source

node-depthclj/s

(node-depth graph node-id)

Compute the depth for node-id and return it.

Compute the depth for node-id and return it.
sourceraw docstring

node-direct-ancestor-chainclj/s

(node-direct-ancestor-chain graph node-id)

Computes ancestor chain for a given node, it only walks as long as there is a single parent on the node, if there is a fork (multiple after-nodes) it will stop.

Computes ancestor chain for a given node, it only walks as long as there is a single
parent on the node, if there is a fork (multiple after-nodes) it will stop.
sourceraw docstring

node-for-attribute-in-chainclj/s

(node-for-attribute-in-chain graph
                             {:com.wsscode.pathom.connect/keys [attribute]
                              :as env}
                             root)

Walks the graph run next chain until it finds the node that's providing the attribute.

Walks the graph run next chain until it finds the node that's providing the
attribute.
sourceraw docstring

node-kindclj/s

(node-kind node)

Return a keyword describing the type of the node.

Return a keyword describing the type of the node.
sourceraw docstring

node-successorsclj/s

(node-successors graph node-id)

Find successor nodes of node-id, node-id is included in the list. This will add branch nodes before run-next nodes. Returns a lazy sequence that traverse the graph as items are requested.

Find successor nodes of node-id, node-id is included in the list. This will add
branch nodes before run-next nodes. Returns a lazy sequence that traverse the graph
as items are requested.
sourceraw docstring

optimize-merge?clj/s

(optimize-merge? graph {:com.wsscode.pathom.connect.planner/keys [node-id]})

Check if node and graph point to same run-next.

Check if node and graph point to same run-next.
sourceraw docstring

params-conflicting-keysclj/s

(params-conflicting-keys m1 m2)

Find conflicting keys between maps m1 and m2, same keys with same values are not considered conflicting keys.

Find conflicting keys between maps m1 and m2, same keys with same values are not
considered conflicting keys.
sourceraw docstring

pc-attrclj/s

source

pc-dyn-symclj/s

source

pc-inputclj/s

source

pc-outputclj/s

source

pc-providesclj/s

source

pc-symclj/s

source

prepare-astclj/s

(prepare-ast env ast)

Prepare AST from 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 query. This will lift placeholder nodes, convert
query to AST and remove children keys that are already present in the current
entity.
sourceraw docstring

previous-node-depthclj/s

(previous-node-depth graph current-node-id previous-node-id)

Get previous node depth, normally it uses the ::node-depth of previous node. There is a special case, when the previous node is a branch node and the current node is the run-next of the previous, in this case the previous depth should return the node chain depth instead, so the depth of the run-next goes after the branch dependencies.

Get previous node depth, normally it uses the ::node-depth of previous node. There
is a special case, when the previous node is a branch node and the current node is
the run-next of the previous, in this case the previous depth should return the node
chain depth instead, so the depth of the run-next goes after the branch dependencies.
sourceraw docstring

push-root-to-ancestorclj/s

(push-root-to-ancestor graph node-id)
source

remove-after-nodeclj/s

(remove-after-node graph node-id after-node-id)
source

remove-branch-node-after-nodesclj/s

(remove-branch-node-after-nodes graph node-id)

When node-id is a branch node, remove all after-nodes associated from its children.

When node-id is a branch node, remove all after-nodes associated from its children.
sourceraw docstring

remove-nodeclj/s

(remove-node graph node-id)

Remove a node from the graph. In case of resolver nodes it also removes them from the ::index-syms and after node references.

Remove a node from the graph. In case of resolver nodes it also removes them
from the ::index-syms and after node references.
sourceraw docstring

resolver-node-requires-attribute?clj/s

(resolver-node-requires-attribute? {:com.wsscode.pathom.connect.planner/keys
                                      [requires sym]}
                                   attribute)
source

resolver-providesclj/s

(resolver-provides {:com.wsscode.pathom.connect/keys [index-resolvers]
                    :com.wsscode.pathom.connect.planner/keys [source-sym]})

Get resolver provides from environment source symbol.

Get resolver provides from environment source symbol.
sourceraw docstring

root-execution-node?clj/s

(root-execution-node? graph node-id)

A node is a root execution is a node without any ancestors, or all ancestors are branch nodes.

A node is a root execution is a node without any ancestors, or all ancestors
are branch nodes.
sourceraw docstring

runner-node-symclj/s

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

Find the runner symbol for a resolver, on normal resolvers that is the resolver symbol, but for foreign resolvers it uses its ::pc/dynamic-sym.

Find the runner symbol for a resolver, on normal resolvers that is the resolver symbol,
but for foreign resolvers it uses its ::pc/dynamic-sym.
sourceraw docstring

same-resolver?clj/s

(same-resolver? node1 node2)

Check if node1 and node2 have the same resolver name.

Check if node1 and node2 have the same resolver name.
sourceraw docstring

set-after-nodeclj/s

(set-after-node graph node-id after-node-id)
source

set-node-run-nextclj/s

(set-node-run-next graph target-node-id run-next)

Set the node run next value and add the after-node counter part. Noop if target and run next are the same node.

Set the node run next value and add the after-node counter part. Noop if target
and run next are the same node.
sourceraw docstring

set-node-run-next*clj/s

(set-node-run-next* graph node-id run-next)

Update the node-id run-next value, if run-next is nil the property will be removed from the map.

Update the node-id run-next value, if run-next is nil the property
will be removed from the map.
sourceraw docstring

set-node-source-for-attrsclj/s

(set-node-source-for-attrs graph
                           {:com.wsscode.pathom.connect/keys [attribute]
                            :as env})
source

set-root-nodeclj/s

(set-root-node graph node-id)
source

transfer-node-after-nodesclj/s

(transfer-node-after-nodes graph
                           target-node-id
                           {:com.wsscode.pathom.connect.planner/keys
                              [after-nodes]})

Set the run next for each after node to be target-node-id.

Set the run next for each after node to be target-node-id.
sourceraw docstring

transfer-node-source-attrsclj/s

(transfer-node-source-attrs graph
                            target-node-id
                            {:com.wsscode.pathom.connect.planner/keys
                               [source-for-attrs]})

Pulls source for attributes from node to target-node-id, also updates the attributes index to respect the transfer.

Pulls source for attributes from node to target-node-id, also updates the attributes
index to respect the transfer.
sourceraw docstring

update-nodeclj/s

(update-node graph node-id k f)
(update-node graph node-id k f v)
(update-node graph node-id k f v v2)
(update-node graph node-id k f v v2 v3)
(update-node graph node-id k f v v2 v3 & args)

Update a given node in a graph, like Clojure native update.

Update a given node in a graph, like Clojure native update.
sourceraw docstring

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

× close