         sym)))
 
 (defn compute-resolver-graph
-  [{::keys [unreachable-syms] :as out}
+  [{::keys [unreachable-syms] :as graph}
    {::keys [run-next]
     :as    env}
    resolver]
   (let [resolver' (runner-node-sym env resolver)]
     (if (contains? unreachable-syms resolver')
-      out
+      graph
       (let [env (assoc env pc-sym resolver' ::source-sym resolver)]
-        (if-let [sym-node-id (get-resolver-extension-node-id out env)]
-          (-> (extend-node-run-next out env sym-node-id)
+        (if-let [sym-node-id (get-resolver-extension-node-id graph env)]
+          (-> (extend-node-run-next graph env sym-node-id)
               (update-in [::nodes sym-node-id ::requires] merge-io {(pc-attr env) {}})
               (update-in [::nodes sym-node-id ::provides] merge-io {(pc-attr env) {}}))
-          (let [node (create-resolver-node out env)]
-            (-> out
+          (let [node (create-resolver-node graph env)]
+            (-> graph
                 (include-node env node)
                 (cond-> (and run-next (not= run-next (::node-id node)))
                         (assoc-in [::nodes run-next ::after-node] (::node-id node)))
                 (compute-root-or env node))))))))
 
 (defn compute-input-resolvers-graph
-  [out
+  [graph
    {::keys [available-data]
     :as    env}
    inputs resolvers]
   (let [missing (into #{} (remove #(contains? available-data %)) inputs)
         env     (assoc env ::input (into {} (map #(hash-map % {})) inputs))]
     (if (contains? inputs (pc-attr env))
-      out
-      (as-> out <>
-        (dissoc out ::root)
+      graph
+      (as-> graph <>
+        (dissoc graph ::root)
         ; resolvers loop
         (reduce
-          (fn [out resolver] (compute-resolver-graph out env resolver))
+          (fn [graph resolver] (compute-resolver-graph graph env resolver))
           <>
           resolvers)
 
         (if (::root <>)
           (-> <>
-              (compute-missing-chain (assoc env ::previous-out out) missing)
-              (compute-root-or env {::node-id (::root out)}))
-          (assoc <> ::root (::root out)))))))
+              (compute-missing-chain (assoc env ::previous-graph graph) missing)
+              (compute-root-or env {::node-id (::root graph)}))
+          (assoc <> ::root (::root graph)))))))
 
 (defn prepare-ast
   "Prepare AST from query. This will lift placeholder nodes, convert

  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 ...))"
  ([out env]
   (-> (compute-run-graph* (merge (base-out) out) (merge (base-env) env))
       collapse-all-dynamic-nodes))

  ([env]
   (compute-run-graph (base-out)
     (merge
       (base-env)
       env))))

                  children))))))

(defn find-latest-providing-node
  [{::keys [root] :as graph}
   {:com.wsscode.pathom.connect/keys [attribute]}]
  (loop [node-id root]
    (let [next-node-id (-> (get-node graph node-id) ::run-next)]
      (cond
        (not next-node-id)
        node-id

        (not (contains? (get-in graph [::nodes next-node-id ::provides]) attribute))
        node-id

        :else
        (recur next-node-id)))))

(defn compute-attribute-graph*
  [{::keys [root] :as graph}
   {:com.wsscode.pathom.connect/keys [index-oir attribute]
    ::keys                           [skip-attr-provided?]
    :as                              env}]
  (if (and skip-attr-provided? (attribute-provided? graph attribute))
    (update-in graph [::nodes root ::requires] merge-io {attribute {}})
    (let [new-graph
          (as-> graph <>
            (dissoc <> ::root)
            (reduce-kv
              (fn [graph inputs resolvers]
                (compute-input-resolvers-graph graph env inputs resolvers))
              <>
              (get index-oir attribute)))]
      (if (::root new-graph)
        (compute-root-and new-graph env {::node-id root})
        (assoc new-graph ::root root)))))

(defn compute-attribute-graph
  "Compute the run graph for a given attribute."
  [{::keys [unreachable-attrs] :as graph}
   {::keys                           [available-data attr-deps-trail]
    :com.wsscode.pathom.connect/keys [index-oir]
    {attr :key}                      :edn-query-language.ast/node
