   #?(:clj
      (:import
        (clojure.lang
-         IAtom
          IDeref))))
 
 ;; pathom core


(def trace-plugin pt/trace-plugin)

(defn collapse-error-path [m path]
  "Reduces the error path to the last available nesting on the map m."
  (vec
    (loop [path' path]
      (if (zero? (count path'))

  [query-expr]
  (-> (query->ast query-expr) :children first))

(defn ast->query
  "Given an AST convert it back into a query expression."
  [query-ast]
  (pp/ast->expr query-ast true))

(defn filter-ast [f ast]
