             [com.wsscode.pathom.test-helpers :as th]
             [com.wsscode.pathom.misc :as p.misc]
             [clojure.core.async :as async :refer [go]]))
+
+(defn index-query? [tx]
+  (try
+    (= (first (ffirst tx)) ::pc/indexes)
+    (catch #?(:clj Throwable :cljs :default) _ false)))
 
 (defn run-parser [{::keys [resolvers query entity foreign error-stack? plugins]}]
   (let [foreign-calls (atom {})

                                                             {::p/wrap-parser
                                                              (fn [parser]
                                                                (fn [env tx]
                                                                  (if (= tx [:critical-error])
                                                                    (throw (ex-info "Parser Error" {:foo "bar"})))
                                                                  (swap! foreign-calls update source-id p.misc/vconj tx)
                                                                  (parser env tx)))}))}

                          foreign
                          (assoc ::ps/foreign-parsers
                            (mapv
                              (fn [{::keys [resolvers foreign-id fatal-error?]}]
                                (let [source-id (or foreign-id (gensym "foreign-source-"))]
                                  (ps/connect-serial-parser
                                    {::ps/connect-reader pc/reader3
