(add-taken-path! {:com.wsscode.pathom3.connect.runner/keys [node-run-stats*]}
{:com.wsscode.pathom3.connect.planner/keys [node-id]}
taken-path-id)
(all-requires-ready? env {:com.wsscode.pathom3.connect.planner/keys [expects]})
Check if all requirements from the node are present in the current entity.
Check if all requirements from the node are present in the current entity.
(assoc-end-plan-stats {:com.wsscode.pathom3.connect.planner/keys [graph]
:as env})
(cache-batch-item
{env' :com.wsscode.pathom3.connect.runner/env
:com.wsscode.pathom3.connect.runner/keys [node-resolver-input]
:com.wsscode.pathom3.connect.operation/keys [cache? cache-store]
:as batch-item}
batch-op
response)
(check-entity-requires! {:com.wsscode.pathom3.connect.planner/keys [graph]
:com.wsscode.pathom3.path/keys [path]
:as env})
Verify if entity contains all required keys from graph index-ast. This is shallow check (don't visit nested entities).
Verify if entity contains all required keys from graph index-ast. This is shallow check (don't visit nested entities).
(combine-inputs-with-responses input-groups inputs responses)
For batch we group the items with the same inputs so the resolver only needs to have each input once. This function is a helper to side the input batch items with the distinct list of responses.
For batch we group the items with the same inputs so the resolver only needs to have each input once. This function is a helper to side the input batch items with the distinct list of responses.
(enhance-dynamic-input {:com.wsscode.pathom3.connect.operation/keys
[dynamic-resolver?]}
node
input-data)
(entry-ast graph k)
Get AST entry and pulls recursive query when needed.
Get AST entry and pulls recursive query when needed.
(include-meta-stats result
{:com.wsscode.pathom3.connect.runner/keys [omit-run-stats?]
:or {omit-run-stats? false}
:as env})
(invoke-mutation! env {:keys [key] :as ast})
Run mutation from AST.
Run mutation from AST.
(invoke-resolver-from-node env
{:com.wsscode.pathom3.connect.operation/keys
[op-name]
:com.wsscode.pathom3.connect.planner/keys [input]
:as node})
Evaluates a resolver using node information.
When this function runs the resolver, if filters the data to only include the keys mentioned by the resolver input. This is important to ensure that the resolver is not using some key that came accidentally due to execution order, that would lead to brittle executions.
Evaluates a resolver using node information. When this function runs the resolver, if filters the data to only include the keys mentioned by the resolver input. This is important to ensure that the resolver is not using some key that came accidentally due to execution order, that would lead to brittle executions.
(mark-node-error {:com.wsscode.pathom3.connect.runner/keys [node-run-stats*]
:as env}
{:com.wsscode.pathom3.connect.planner/keys [node-id]}
error)
(merge-entity-data env entity new-data)
Specialized merge versions that work on entity data.
Specialized merge versions that work on entity data.
(merge-mutation-stats! {:com.wsscode.pathom3.connect.runner/keys
[node-run-stats*]}
{:com.wsscode.pathom3.connect.operation/keys [op-name]}
data)
(merge-node-stats! {:com.wsscode.pathom3.connect.runner/keys [node-run-stats*]}
{:com.wsscode.pathom3.connect.planner/keys [node-id]}
data)
(merge-resolver-response! env response)
This function gets the map returned from the resolver and merge the data in the current cache-tree.
This function gets the map returned from the resolver and merge the data in the current cache-tree.
(missing-maybe-in-pending-batch? {:com.wsscode.pathom3.path/keys [path] :as env}
input)
Check if there is any pending batching in the sub-path of the current input.
During the serial execution, a nested input process may be halted waiting to run after the all entities pass. In this case we need to also halt the execution to wait for that dependent input batch to run before moving on to process this node.
Check if there is any pending batching in the sub-path of the current input. During the serial execution, a nested input process may be halted waiting to run after the all entities pass. In this case we need to also halt the execution to wait for that dependent input batch to run before moving on to process this node.
(node-weight {:com.wsscode.pathom3.connect.planner/keys [graph]
:com.wsscode.pathom3.connect.runner/keys [resolver-weights*]
:as env}
node-id)
Sums up the weight of a node and its successors
Sums up the weight of a node and its successors
(normalize-ast-recursive-query {:keys [query] :as ast} graph k)
(placeholder-merge-entity {:com.wsscode.pathom3.connect.planner/keys [graph]
:com.wsscode.pathom3.connect.runner/keys
[source-entity]})
Create an entity to process the placeholder demands. This consider if the placeholder has params, params in placeholders means that you want some specific data at that point.
Create an entity to process the placeholder demands. This consider if the placeholder has params, params in placeholders means that you want some specific data at that point.
(priority-sort {:com.wsscode.pathom3.connect.planner/keys [graph] :as env}
or-node
node-ids)
Find the node path with the highest priority to run. Returns a set of the candidates with the same priority level.
Find the node path with the highest priority to run. Returns a set of the candidates with the same priority level.
(process-attr-subquery {:com.wsscode.pathom3.connect.planner/keys [graph]
:as env}
entity
k
v)
(process-idents! env idents)
Process the idents from the Graph, this will add the ident data into the child.
If there is ident data already, it gets merged with the ident value.
Process the idents from the Graph, this will add the ident data into the child. If there is ident data already, it gets merged with the ident value.
(process-map-container-subquery env ast m)
Build a new map where the values are replaced with the map process of the subquery.
Build a new map where the values are replaced with the map process of the subquery.
(process-map-container? ast v)
Check if the map should be processed as a map-container, this means the sub-query should apply to the map values instead of the map itself.
This can be dictated by adding the ::pcr/map-container? meta data on the value, or requested by the query as part of the param.
Check if the map should be processed as a map-container, this means the sub-query should apply to the map values instead of the map itself. This can be dictated by adding the ::pcr/map-container? meta data on the value, or requested by the query as part of the param.
(process-mutations! {:com.wsscode.pathom3.connect.planner/keys [graph] :as env})
Runs the mutations gathered by the planner.
Runs the mutations gathered by the planner.
(report-resolver-error {:com.wsscode.pathom3.path/keys [path]
:com.wsscode.pathom3.error/keys [lenient-mode?]
:as env}
{:com.wsscode.pathom3.connect.operation/keys [op-name]
:as node}
error)
(report-resolver-io-stats {:com.wsscode.pathom3.connect.runner/keys
[omit-run-stats-resolver-io?]}
input-data
result)
(resolver-already-ran? {:com.wsscode.pathom3.connect.runner/keys
[node-run-stats*]}
{:com.wsscode.pathom3.connect.planner/keys [node-id]})
(run-and-node! {:com.wsscode.pathom3.connect.planner/keys [graph] :as env}
{:com.wsscode.pathom3.connect.planner/keys [run-and]
:as and-node})
Given an AND node, runs every attached node, then runs the attached next.
Given an AND node, runs every attached node, then runs the attached next.
(run-graph! env ast-or-graph entity-tree*)
Plan and execute a request, given an environment (with indexes), the request AST and the entity-tree*.
Plan and execute a request, given an environment (with indexes), the request AST and the entity-tree*.
(run-graph!* {:com.wsscode.pathom3.connect.planner/keys [graph] :as env})
Run the root node of the graph. As resolvers run, the result will be add to the entity cache tree.
Run the root node of the graph. As resolvers run, the result will be add to the entity cache tree.
(run-next-node! {:com.wsscode.pathom3.connect.planner/keys [graph] :as env}
{:com.wsscode.pathom3.connect.planner/keys [run-next]})
Runs the next node associated with the node, in case it exists.
Runs the next node associated with the node, in case it exists.
(run-node! env node)
Run a node from the compute graph. This will start the processing on the sent node and them will run everything that's connected to this node as sequences of it.
The result is going to build up at ::p.ent/cache-tree*, after the run is concluded the output will be there.
Run a node from the compute graph. This will start the processing on the sent node and them will run everything that's connected to this node as sequences of it. The result is going to build up at ::p.ent/cache-tree*, after the run is concluded the output will be there.
(run-or-node! {:com.wsscode.pathom3.connect.planner/keys [graph]
:com.wsscode.pathom3.connect.runner/keys [choose-path]
:or {choose-path default-choose-path}
:as env}
{:com.wsscode.pathom3.connect.planner/keys [run-or] :as or-node})
(run-resolver-node! env node)
This function evaluates the resolver associated with the node.
First it checks if the expected results from the resolver are already available. In case they are, the resolver call is skipped.
This function evaluates the resolver associated with the node. First it checks if the expected results from the resolver are already available. In case they are, the resolver call is skipped.
(run-root-node! {:com.wsscode.pathom3.connect.planner/keys [graph] :as env})
(runnable-graph? graph)
Quick check to see if the graph has something to run. In the false case we can skip the running section.
Quick check to see if the graph has something to run. In the false case we can skip the running section.
(validate-response! env
{:com.wsscode.pathom3.connect.operation/keys [op-name]
:as node}
response)
(weight-sort {:com.wsscode.pathom3.connect.runner/keys [resolver-weights*]
:as env}
_or-node
candidates)
Sorts nodes based on the weight of their paths. The weight is calculated every time a resolver runs.
Sorts nodes based on the weight of their paths. The weight is calculated every time a resolver runs.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close