Liking cljdoc? Tell your friends :D
All platforms.

com.wsscode.pathom3.connect.planner


add-branch-to-nodeclj/s

(add-branch-to-node graph target-node-id branch-type new-branch-node-id)
source

add-ident-processclj/s

(add-ident-process graph {:keys [key]})
source

add-node-branchesclj/s

(add-node-branches graph target-node-id branch-type node-ids)
source

add-node-parentclj/s

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

add-placeholder-entryclj/s

(add-placeholder-entry graph attr)
source

add-resolvers-trailclj/s

(add-resolvers-trail env resolvers)
source

add-snapshot!clj/s

(add-snapshot! graph
               {:com.wsscode.pathom3.connect.planner/keys [snapshots*
                                                           snapshot-depth]}
               event-details)
source

add-unreachable-pathclj/s

(add-unreachable-path graph env path)

Add attribute to unreachable list

Add attribute to unreachable list
sourceraw docstring

add-warningclj/s

(add-warning graph warn)
source

assoc-nodeclj/s

(assoc-node graph node-id k v)

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

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

attr-optional?clj/s

(attr-optional? {:com.wsscode.pathom3.connect.planner/keys [index-ast]}
                attribute-kw)
source

base-envclj/s

(base-env)
source

base-graphclj/s

(base-graph)
source

branch-node?clj/s

(branch-node? node)

Returns true when the node is a branch node type.

Returns true when the node is a branch node type.
sourceraw docstring

can-merge-sibling-resolver-nodes?clj/s

(can-merge-sibling-resolver-nodes? graph node-id1 node-id2)
source

combine-expectsclj/s

(combine-expects na nb)
source

combine-foreign-astclj/s

(combine-foreign-ast na nb)
source

combine-inputsclj/s

(combine-inputs na nb)
source

combine-run-nextclj/s

(combine-run-next graph env node-ids pivot)

Combine each node in node-ids with the pivot run next, this version will use AND node to connect the run next items

Combine each node in node-ids with the pivot run next, this version will use
AND node to connect the run next items
sourceraw docstring

combine-run-next*clj/s

(combine-run-next* graph env branch-type node-ids pivot node-defaults)

Combine run next of elements, in case both have a run-next, a branch node will be placed there connecting both next nodes.

Combine run next of elements, in case both have a run-next, a branch node will
be placed there connecting both next nodes.
sourceraw docstring

compare-AND-children-denormclj/s

(compare-AND-children-denorm node)
source

compute-attribute-dependency-graphclj/s

(compute-attribute-dependency-graph
  graph
  {:com.wsscode.pathom3.connect.planner/keys [recursive-joins] :as env}
  attr
  shape)
source

compute-attribute-graphclj/s

(compute-attribute-graph
  {:com.wsscode.pathom3.connect.planner/keys [unreachable-paths] :as graph}
  {:com.wsscode.pathom3.connect.planner/keys [attr-deps-trail]
   :com.wsscode.pathom3.connect.indexes/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* graph
                          {:com.wsscode.pathom3.connect.indexes/keys [index-oir]
                           :com.wsscode.pathom3.attribute/keys [attribute]
                           :as env})

Traverse the attribute options, for example, considering we are processing the attribute :a. And we have this index:

{::pci/index-oir {:a {{} #{a}}}}

This means we are now at the {{} #{a}} part, lets call each entry of this map a process path.

To break it down, in this case we have one process path to get :a. Each process pair contains an input shape and a set of resolvers.

You can read it as: I can fetch :a providing the data {} to the resolver a.

A bigger example:

{::pci/index-oir {:a {{:b {}} #{a-from-b}
                      {:c {}} #{a-from-c a-f-c}}}}

In this case we have two process paths.

This function iterates over each process path, if at least one can complete the path, it returns a graph with a root o the node. In case of many options, an OR node will be the root, providing each path.

Traverse the attribute options, for example, considering we are processing the
attribute `:a`. And we have this index:

    {::pci/index-oir {:a {{} #{a}}}}

This means we are now at the `{{} #{a}}` part, lets call each entry of this map a
`process path`.

To break it down, in this case we have one `process path` to get `:a`. Each process
pair contains an input shape and a set of resolvers.

You can read it as: I can fetch `:a` providing the data `{}` to the resolver `a`.

A bigger example:

    {::pci/index-oir {:a {{:b {}} #{a-from-b}
                          {:c {}} #{a-from-c a-f-c}}}}

In this case we have two process paths.

This function iterates over each process path, if at least one can complete the path,
it returns a graph with a root o the node. In case of many options, an OR node will
be the root, providing each path.
sourceraw docstring

compute-attribute-nested-input-requireclj/s

(compute-attribute-nested-input-require graph env attr shape nodes)
source

compute-dynamic-nested-requirementsclj/s

(compute-dynamic-nested-requirements
  {:com.wsscode.pathom3.attribute/keys [attribute]
   :com.wsscode.pathom3.connect.operation/keys [op-name]
   ast :edn-query-language.ast/node
   :as env})

Considering the operation output, find out what a query can extend during nesting.

Pathom uses it to compute the dynamic requirements to send into dynamic resolvers.

This function is a useful tool for developers of custom dynamic resolvers.

Considering the operation output, find out what a query can extend during nesting.

Pathom uses it to compute the dynamic requirements to send into dynamic resolvers.

This function is a useful tool for developers of custom dynamic resolvers.
sourceraw docstring

compute-dynamic-nested-requirements*clj/s

(compute-dynamic-nested-requirements* {ast :edn-query-language.ast/node :as env}
                                      dynamic-name
                                      available)
source

compute-dynamic-nested-union-requirements*clj/s

(compute-dynamic-nested-union-requirements* {ast :edn-query-language.ast/node
                                             :as env}
                                            dynamic-name
                                            available)
source

compute-input-resolvers-graphclj/s

(compute-input-resolvers-graph graph
                               {:com.wsscode.pathom3.connect.planner/keys
                                  [available-data attr-resolvers-trail]
                                :com.wsscode.pathom3.attribute/keys [attribute]
                                :as env}
                               input
                               resolvers)

This function computes the graph for a given process path. It creates the resolver nodes to execute the resolvers, in case of many resolvers it uses a OR node to combine them.

Then it fetches the dependencies, declared in the process path. If the dependencies are successfully computed, it returns the graph with the root on the node that fulfills the request.

This function computes the graph for a given `process path`. It creates the resolver
nodes to execute the resolvers, in case of many resolvers it uses a OR node to combine
them.

Then it fetches the dependencies, declared in the process path. If the dependencies
are successfully computed, it returns the graph with the root on the node that
fulfills the request.
sourceraw docstring

compute-missing-chainclj/s

(compute-missing-chain graph env missing missing-optionals)

Start a recursive call to process the dependencies required by the resolver.

Start a recursive call to process the dependencies required by the resolver.
sourceraw docstring

compute-missing-chain-depsclj/s

(compute-missing-chain-deps
  graph
  {:com.wsscode.pathom3.connect.planner/keys [available-data] :as env}
  missing)
source

compute-missing-chain-optional-depsclj/s

(compute-missing-chain-optional-deps
  graph
  {:com.wsscode.pathom3.connect.planner/keys [available-data] :as env}
  opt-missing
  node-map)
source

compute-nested-requirementsclj/s

(compute-nested-requirements
  {:com.wsscode.pathom3.connect.planner/keys [available-data]
   :com.wsscode.pathom3.attribute/keys [attribute]
   :com.wsscode.pathom3.connect.operation/keys [op-name]
   ast :edn-query-language.ast/node
   :as env})
source

compute-non-index-attributeclj/s

(compute-non-index-attribute graph
                             {:com.wsscode.pathom3.connect.planner/keys
                                [available-data]
                              {attr :key :as ast} :edn-query-language.ast/node
                              :as env})

This function deals with attributes that are not part of the index execution. The cases here are:

  • EQL idents
  • Previously available data
  • Placeholders
This function deals with attributes that are not part of the index execution. The
cases here are:

- EQL idents
- Previously available data
- Placeholders
sourceraw docstring

compute-plan-snapshotsclj/s

(compute-plan-snapshots env)

Run compute graph capturing snapshots, return the snapshots vector in the end.

Run compute graph capturing snapshots, return the snapshots vector in the end.
sourceraw docstring

compute-resolver-leafclj/s

(compute-resolver-leaf graph
                       {:com.wsscode.pathom3.connect.planner/keys [input]
                        :as env}
                       resolvers)

For a set of resolvers (the R part of OIR index), create one OR node that branches to each option in the set.

For a set of resolvers (the R part of OIR index), create one OR node that branches
to each option in the set.
sourceraw docstring

compute-run-graphclj/s

(compute-run-graph env)
(compute-run-graph graph
                   {:com.wsscode.pathom3.connect.planner/keys [optimize-graph?]
                    :or {optimize-graph? true}
                    :as 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 {::pco/op-name      a
                             ::node-id          1
                             ::requires         {:a {}}
                             ::input            {}
                             ::source-for-attrs #{:a}
                             ::node-parents      #{3}}
                          2 {::pco/op-name      b
                             ::node-id          2
                             ::requires         {:b {}}
                             ::input            {}
                             ::source-for-attrs #{:b}
                             ::node-parents      #{3}}
                          3 {::node-id  3
                             ::requires {:b {} :a {} :c {}}
                             ::run-and  #{2 1 4}}
                          4 {::pco/op-name      c
                             ::node-id          4
                             ::requires         {:c {}}
                             ::input            {}
                             ::source-for-attrs #{:c}
                             ::node-parents      #{3}}}
 ::index-resolver->nodes {a #{1} b #{2} c #{4}}
 ::unreachable-attrs     #{}
 ::index-attrs           {:a #{1} :b #{2} :c #{4}}
 ::root                  3}
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 {::pco/op-name      a
                                 ::node-id          1
                                 ::requires         {:a {}}
                                 ::input            {}
                                 ::source-for-attrs #{:a}
                                 ::node-parents      #{3}}
                              2 {::pco/op-name      b
                                 ::node-id          2
                                 ::requires         {:b {}}
                                 ::input            {}
                                 ::source-for-attrs #{:b}
                                 ::node-parents      #{3}}
                              3 {::node-id  3
                                 ::requires {:b {} :a {} :c {}}
                                 ::run-and  #{2 1 4}}
                              4 {::pco/op-name      c
                                 ::node-id          4
                                 ::requires         {:c {}}
                                 ::input            {}
                                 ::source-for-attrs #{:c}
                                 ::node-parents      #{3}}}
     ::index-resolver->nodes {a #{1} b #{2} c #{4}}
     ::unreachable-attrs     #{}
     ::index-attrs           {:a #{1} :b #{2} :c #{4}}
     ::root                  3}
sourceraw docstring

compute-run-graph*clj/s

(compute-run-graph* graph env)

Starts scanning the AST to plan for each attribute.

Starts scanning the AST to plan for each attribute.
sourceraw docstring

create-andclj/s

(create-and graph env node-ids)
source

create-node-for-resolver-callclj/s

(create-node-for-resolver-call
  {:com.wsscode.pathom3.connect.planner/keys [input]
   :com.wsscode.pathom3.attribute/keys [attribute]
   :com.wsscode.pathom3.connect.operation/keys [op-name]
   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

create-root-andclj/s

(create-root-and graph env node-ids)
source

create-root-orclj/s

(create-root-or graph
                {:com.wsscode.pathom3.attribute/keys [attribute] :as env}
                node-ids)
source

denormalize-nodeclj/s

(denormalize-node
  {:com.wsscode.pathom3.connect.planner/keys [denorm-update-node] :as graph}
  node-id)

Compute a version of the node that contains all forward references denormalized. It means instead of having the ids at run-next/branches (both OR and AND) the node will have the node data itself directly there. The denormalized version is added using the node-id at the ::nodes-denormalized key in the graph. All subsequent nodes are also denormalized in the process and also add to ::nodes-denormalized, so a lookup for then will be also readly available.

Compute a version of the node that contains all forward references denormalized. It means
instead of having the ids at run-next/branches (both OR and AND) the node will have
the node data itself directly there. The denormalized version is added using the node-id
at the ::nodes-denormalized key in the graph. All subsequent nodes are also denormalized
in the process and also add to ::nodes-denormalized, so a lookup for then will be
also readly available.
sourceraw docstring

disj-remclj/s

(disj-rem m k item)
source

entry-astclj/s

(entry-ast graph k)

Find AST node a given entry from the source AST.

Find AST node a given entry from the source AST.
sourceraw docstring

extend-attribute-sub-queryclj/s

(extend-attribute-sub-query graph
                            {:com.wsscode.pathom3.connect.planner/keys
                               [optional-process?]}
                            attr
                            shape)
source

extend-available-attribute-nestedclj/s

(extend-available-attribute-nested
  graph
  {:com.wsscode.pathom3.connect.planner/keys [available-data] :as env}
  attr
  shape)
source

find-chain-startclj/s

(find-chain-start graph node-id)

Given a graph and a node-id, walks the run-next chain until it finds the first node that's connected to a branch parent (via branch relationship, not as run next) or the root.

Given a graph and a node-id, walks the run-next chain until it finds the first node
that's connected to a branch parent (via branch relationship, not as run next) or
the root.
sourceraw docstring

find-direct-node-successorsclj/s

(find-direct-node-successors
  {:com.wsscode.pathom3.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

find-leaf-nodeclj/s

(find-leaf-node graph node)

Traverses all run-next still it reaches a leaf.

Traverses all run-next still it reaches a leaf.
sourceraw docstring

find-root-resolver-nodesclj/s

(find-root-resolver-nodes {:com.wsscode.pathom3.connect.planner/keys [root]
                           :as graph})

Returns the first resolvers to get called in the graph. This will traverse AND and OR node branches until the first resolvers are found. This function doesn't work the run-next of nodes.

Returns the first resolvers to get called in the graph. This will traverse AND and OR
node branches until the first resolvers are found. This function doesn't work the
run-next of nodes.
sourceraw docstring

find-run-next-descendantsclj/s

(find-run-next-descendants graph
                           {:com.wsscode.pathom3.connect.planner/keys
                              [node-id]})

Return descendants by walking the run-next

Return descendants by walking the run-next
sourceraw docstring

get-denormalized-nodeclj/s

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

get-nodeclj/s

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

get-root-nodeclj/s

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

Returns the root node of the graph.

Returns the root node of the graph.
sourceraw docstring

graph-providesclj/s

(graph-provides {:com.wsscode.pathom3.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

ignore-nilsclj/s

(ignore-nils m)
source

inc-snapshot-depthclj/s

(inc-snapshot-depth env)
source

include-nodeclj/s

(include-node graph
              {:com.wsscode.pathom3.connect.planner/keys [node-id]
               :com.wsscode.pathom3.connect.operation/keys [op-name]
               :as node})

Add new node to the graph, this add the node and the index of in ::index-syms.

Add new node to the graph, this add the node and the index of in ::index-syms.
sourceraw docstring

keep-required-transducerclj/s

source

mark-attribute-process-sub-queryclj/s

(mark-attribute-process-sub-query graph {:keys [key children query]})

Add information about attribute that is present but requires further processing due to subquery, this is created so the runner can quickly know which attributes need to have the subquery processing done.

Add information about attribute that is present but requires further processing
due to subquery, this is created so the runner can quickly know which attributes
need to have the subquery processing done.
sourceraw docstring

matching-chains?clj/s

(matching-chains? chain-a chain-b)
source

merge-ast-childrenclj/s

(merge-ast-children a b)
source

merge-placeholder-astclj/s

(merge-placeholder-ast index-ast placeholder-ast)
source

merge-sibling-equal-branchesclj/s

(merge-sibling-equal-branches graph
                              env
                              parent-node-id
                              [target-node-id & mergeable-siblings-ids :as
                               node-ids])
source

merge-sibling-or-sub-chainsclj/s

(merge-sibling-or-sub-chains graph env [chain & other-chains])
source

merge-sibling-resolver-nodeclj/s

(merge-sibling-resolver-node graph target-node-id source-node-id)

Merges data from source-node-id into target-node-id, them removes the source node.

Merges data from source-node-id into target-node-id, them removes the source node.
sourceraw docstring

merge-sibling-resolver-nodesclj/s

(merge-sibling-resolver-nodes graph env parent-node-id node-ids)
source

merge-sibling-resolver-nodes*clj/s

(merge-sibling-resolver-nodes* graph pivot node-ids)
source

merge-unreachableclj/s

(merge-unreachable target-graph
                   {:com.wsscode.pathom3.connect.planner/keys
                      [unreachable-paths]})
(merge-unreachable target-graph graph env path)

Copy unreachable attributes from discard-graph to target-graph. Using the extra arity you can also add a new unreachable path in the same call.

Copy unreachable attributes from discard-graph to target-graph. Using the extra arity
you can also add a new unreachable path in the same call.
sourceraw docstring

move-branch-item-nodeclj/s

(move-branch-item-node graph target-parent-id node-id)

Move a branch item from source parent target parent.

Move a branch item from source parent target parent.
sourceraw docstring

move-branches-to-another-nodeclj/s

(move-branches-to-another-node graph source-node-id target-node-id)
source

move-run-next-to-edgeclj/s

(move-run-next-to-edge graph target-node-id node-to-move-id)

Find the node at the end of chain from target-node-id and move node-to-move-id as the next of that

Find the node at the end of chain from target-node-id and move node-to-move-id
as the next of that
sourceraw docstring

new-nodeclj/s

(new-node env node-data)
source

next-node-idclj/s

(next-node-id {:com.wsscode.pathom3.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-attribute-providesclj/s

(node-attribute-provides graph env attr)

For a specific attribute, return a vector containing the provides of each node of that resolver, or the current available data for it.

For a specific attribute, return a vector containing the provides of each node of
that resolver, or the current available data for it.
sourceraw docstring

node-branch-typeclj/s

(node-branch-type node)
source

node-branchesclj/s

(node-branches node)

Return node branches, which can be the ::run-and or the ::run-or part of the node.

Return node branches, which can be the ::run-and or the ::run-or part of the node.
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-optional?clj/s

(node-optional? {:com.wsscode.pathom3.connect.planner/keys [params]})
source

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

node-with-resolver-configclj/s

(node-with-resolver-config graph env node-id)

Get the node plus the resolver config, when the node has an op-name. If node is not a resolver not it returns nil.

Get the node plus the resolver config, when the node has an op-name. If node is
not a resolver not it returns nil.
sourceraw docstring

optimize-AND-branchesclj/s

(optimize-AND-branches graph env node-id)
source

optimize-AND-nestedclj/s

(optimize-AND-nested graph env node-id)

This pass will look for branches of an AND node that are also AND nodes. In case further AND doesn't contain a run-next, it can be safely merged with the parent AND.

AND > AND -> A > -> A -> AND > -> B -> B > -> C -> C >

This pass will look for branches of an AND node that are also AND nodes. In case
further AND doesn't contain a run-next, it can be safely merged with the parent AND.

  AND           >        AND
  -> A          >        -> A
  -> AND        >        -> B
     -> B       >        -> C
     -> C       >
sourceraw docstring

optimize-AND-resolver-siblingsclj/s

(optimize-AND-resolver-siblings graph env parent-id pivot other-nodes)
source

optimize-AND-resolvers-passclj/s

(optimize-AND-resolvers-pass graph env parent-id)

This pass will collapse the same resolver node branches. This also do a local optimization on AND's and OR's sub-nodes. This is important to simplify the pass to merge OR nodes.

This pass will collapse the same resolver node branches. This also do a local optimization
on AND's and OR's sub-nodes. This is important to simplify the pass to merge OR nodes.
sourceraw docstring

optimize-branch-itemsclj/s

(optimize-branch-items graph env branch-node-id)
source

optimize-graphclj/s

(optimize-graph graph env)
source

optimize-nested-branch-with-same-branchesclj/s

(optimize-nested-branch-with-same-branches graph env node-id)

Similar to optimize-siblings-with-same-braches, but looks if a branch node has a children item that has the same branch structure as the parent.

Similar to optimize-siblings-with-same-braches, but looks if a branch node has a children
item that has the same branch structure as the parent.
sourceraw docstring

optimize-nested-ORclj/s

(optimize-nested-OR graph env node-id)
source

optimize-nodeclj/s

(optimize-node graph env node-id)
source

optimize-OR-branchesclj/s

(optimize-OR-branches graph env node-id)
source

optimize-OR-sub-pathsclj/s

(optimize-OR-sub-paths graph env node-id)

This function looks to match branches of the OR node that are sub-paths of each other (eg: A, A -> B, merge to just A -> B). In this case we can merge those chains and return the number of branches in the OR node.

At this moment this fn only deals with paths that have only resolvers, it may look for paths with sub-branches in the future.

This function looks to match branches of the OR node that are
sub-paths of each other (eg: A, A -> B, merge to just A -> B). In this case we can
merge those chains and return the number of branches in the OR node.

At this moment this fn only deals with paths that have only resolvers,
it may look for paths with sub-branches in the future.
sourceraw docstring

optimize-resolver-chainclj/s

(optimize-resolver-chain graph env node-id)

Merge node and its run-next, when they are the same dynamic resolver.

Merge node and its run-next, when they are the same dynamic resolver.
sourceraw docstring

optimize-resolver-chain?clj/s

(optimize-resolver-chain? graph
                          {:com.wsscode.pathom3.connect.operation/keys [op-name]
                           :com.wsscode.pathom3.connect.planner/keys
                             [run-next]})
source

optimize-resolver-nodeclj/s

(optimize-resolver-node graph env node-id)
source

optimize-siblings-with-same-branchesclj/s

(optimize-siblings-with-same-branches graph env node-id)

When sibling branch nodes are of the same type and have the same branch structure we can merge then.

When sibling branch nodes are of the same type and have the same branch structure we
can merge then.
sourceraw docstring

plan-mutationclj/s

(plan-mutation graph env {:keys [key] :as ast})
source

plan-mutation-nested-queryclj/s

(plan-mutation-nested-query env {:keys [key] :as ast})
source

promote-foreign-ast-childrenclj/s

(promote-foreign-ast-children
  {:com.wsscode.pathom3.connect.planner/keys [foreign-ast] :as ast})

Moves the children from foreign ast to the main children. Also removes the foreign ast attribute.

Moves the children from foreign ast to the main children. Also removes the foreign
ast attribute.
sourceraw docstring

push-pathclj/s

(push-path env
           {:com.wsscode.pathom3.attribute/keys [attribute]
            :com.wsscode.pathom3.path/keys [path]})
source

rehydrate-graph-identsclj/s

(rehydrate-graph-idents graph ast)

To optimize the plan caching Pathom will remove the values of the idents at the cache key. But upon later usage of the cache, the cache key will hit the previous AST, but that AST still has the initial values used on caching. This function will rehydrate the AST replacing the cached ident values with the current ident values.

To optimize the plan caching Pathom will remove the values of the idents at the cache
key. But upon later usage of the cache, the cache key will hit the previous AST, but
that AST still has the initial values used on caching. This function will rehydrate
the AST replacing the cached ident values with the current ident values.
sourceraw docstring

remove-branch-node-parentsclj/s

(remove-branch-node-parents graph node-id)

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

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

remove-from-parent-branchclj/s

(remove-from-parent-branch graph node-id parent-id)

Disconnect a branch node from its parents.

Disconnect a branch node from its parents.
sourceraw docstring

remove-from-parent-branchesclj/s

(remove-from-parent-branches graph
                             {:com.wsscode.pathom3.connect.planner/keys
                                [node-id node-parents]})

Disconnect a branch node from its parents.

Disconnect a branch node from its parents.
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, the index-attrs and after node references.

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

remove-node*clj/s

(remove-node* graph node-id)

Remove a node from the graph. Doesn't remove any references, caution!

Remove a node from the graph. Doesn't remove any references, caution!
sourceraw docstring

remove-node-edgesclj/s

(remove-node-edges graph node-id)

Remove all node connections. This disconnect the nodes from parents and run-next.

Remove all node connections. This disconnect the nodes from parents and run-next.
sourceraw docstring

remove-node-expects-index-attrsclj/s

(remove-node-expects-index-attrs graph node-id)

Since the node has attribute indexes associated with it, this removes those links considering the attributes listed on expects.

Since the node has attribute indexes associated with it, this removes those links
considering the attributes listed on expects.
sourceraw docstring

remove-node-parentclj/s

(remove-node-parent graph node-id node-parent-id)

Disconnect the parent node node-parent-id from node node-id

Disconnect the parent node node-parent-id from node node-id
sourceraw docstring

remove-root-node-clusterclj/s

(remove-root-node-cluster graph node-ids)

Remove a complete node cluster, starting from some node root.

Remove a complete node cluster, starting from some node root.
sourceraw docstring

remove-run-next-edgeclj/s

(remove-run-next-edge graph node-id)
source

required-ast-from-index-astclj/s

(required-ast-from-index-ast {:com.wsscode.pathom3.connect.planner/keys
                                [index-ast]})
source

required-ast-from-source-astclj/s

(required-ast-from-source-ast {:com.wsscode.pathom3.connect.planner/keys
                                 [source-ast]})
source

reset-envclj/s

(reset-env env)

Restore the original environment sent to run-graph! Use this for nested graphs that need a clean environment.

Restore the original environment sent to run-graph! Use this for nested graphs
that need a clean environment.
sourceraw docstring

resolvers-missing-optionalsclj/s

(resolvers-missing-optionals
  {:com.wsscode.pathom3.connect.planner/keys [available-data] :as env}
  resolvers)

Merge the optionals from a collection of resolver symbols.

Merge the optionals from a collection of resolver symbols.
sourceraw docstring

runner-node-symclj/s

(runner-node-sym env resolver-name)

Find the runner symbol for a resolver, on normal resolvers that is the resolver symbol, but for foreign resolvers it uses its ::p.c.o/dynamic-name.

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

sanitize-paramsclj/s

(sanitize-params params)
source

set-node-expectsclj/s

(set-node-expects graph node-id expects)

Set node expects, this also removes previous references from index-attrs and add new ones for the new expects.

Set node expects, this also removes previous references from index-attrs and add
new ones for the new expects.
sourceraw docstring

set-node-run-nextclj/s

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

Set the node run next value and add the node-parent counterpart. Noop if target and run next are the same node.

Set the node run next value and add the node-parent counterpart. 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 attribute will be removed from the map.

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

set-node-source-for-attrsclj/s

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

set-root-nodeclj/s

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

shape-descriptor->ast-children-optionalclj/s

(shape-descriptor->ast-children-optional shape)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

shape-descriptor->ast-optionalclj/s

(shape-descriptor->ast-optional shape)

Convert pathom output format into shape descriptor format.

Convert pathom output format into shape descriptor format.
sourceraw docstring

shape-reachable?clj/s

(shape-reachable? {:com.wsscode.pathom3.connect.planner/keys [resolvers]
                   :as env}
                  available
                  shape)

Given an environment, available data and shape, determines if the whole shape is reachable (including nested dependencies).

Given an environment, available data and shape, determines if the whole shape
is reachable (including nested dependencies).
sourceraw docstring

simplify-single-branch-nodeclj/s

(simplify-single-branch-node graph env node-id)

When a branch node contains a single branch out, remove the node and put that single item in place.

Note in case the branch has a run-next, that run-next gets moved to the end of chain to retain the same order as it would run with the branch.

When a branch node contains a single branch out, remove the node and put that
single item in place.

Note in case the branch has a run-next, that run-next gets moved to the end of chain
to retain the same order as it would run with the branch.
sourceraw docstring

sub-sequence?clj/s

(sub-sequence? seq-a seq-b)
source

transfer-node-indexesclj/s

(transfer-node-indexes graph target-node-id source-node-id)
source

transfer-node-parentclj/s

(transfer-node-parent graph target-node-id source-node-id node-id)

Transfer the node parent from source node to target node. This function will also update the parents references to point to target node.

Transfer the node parent from source node to target node. This function will also
update the parents references to point to target node.
sourceraw docstring

transfer-node-parentsclj/s

(transfer-node-parents graph target-node-id source-node-id)

Transfer node parents from source node to target node. In case source node is root, the root will be transferred to target node.

Transfer node parents from source node to target node. In case source node is root,
the root will be transferred to target node.
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

verify-plan!clj/s

(verify-plan! {:com.wsscode.pathom3.error/keys [lenient-mode?] :as env} graph)

This will cause an exception to throw in case the plan can't reach some required attribute

This will cause an exception to throw in case the plan can't reach some required
attribute
sourceraw docstring

verify-plan!*clj/s

(verify-plan!* env
               {:com.wsscode.pathom3.connect.planner/keys [unreachable-paths]
                :as graph})
source

with-plan-cacheclj/s

(with-plan-cache env)
(with-plan-cache env cache*)
source

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

× close