       (get-in index-resolvers [(pc-sym node) :com.wsscode.pathom.connect/provides]))))
 
 (defn find-dynamic-node-to-merge
+  "Given some branch node, tries to find a node with a dynamic resolver that's the
+  same sym as the node in node-id."
   [{::keys [root] :as out}
    {::keys [branch-type]
     :as    env}

  (let [node     (get-in out [::nodes node-id])
        node-sym (pc-sym node)]
    (if (dynamic-resolver? env node-sym)
      (some #(if (= node-sym (get-in out [::nodes % pc-sym])) %) (get-in out [::nodes root branch-type])))))

(defn simplify-branch
  [{::keys [root] :as out}
   {::keys [branch-type]}]
  (let [items (get-in out [::nodes root branch-type])]

        (assoc ::run-next run-next)))))

(defn extend-resolver-run-next
  "Extend resolver run next, adding the current run-next from env to it. If the sym
  nodes don't have a run-next, it will be set for the one informed by the env. In case
  there is already something to run next the node, a wrap AND branch node will be
  inserted containing the previous node and the new one."
  [{::keys [index-syms] :as out}
   {::keys [run-next run-next-trail] :as env}]
  (if run-next
