 (defn parallel-env [key]
   (assoc (parallel-env-base) :ast (p/query->ast1 [key])))
 
-(defn call-parallel-reader [env key]
-  (reset! trace [])
-  (let [res (pc/parallel-reader (merge (parallel-env key) {::p/path [key]} env))]
-    (if (::pp/response-stream res)
-      (update res ::pp/response-stream (fn [x] (async/<!! (async/into [] x))))
-      res)))
+#?(:clj
+   (defn call-parallel-reader [env key]
+     (reset! trace [])
+     (let [res (pc/parallel-reader (merge (parallel-env key) {::p/path [key]} env))]
+       (if (::pp/response-stream res)
+         (update res ::pp/response-stream (fn [x] (async/<!! (async/into [] x))))
+         res))))
 
 (defn comparable-trace [trace]
   (mapv #(dissoc % ::pt/timestamp ::pt/id) trace))
 
 (defn comparable-trace-in-any-order [trace]
   (frequencies (comparable-trace trace)))
-
-(comment
-  (pc/parallel-reader (assoc (parallel-env :b)
-                        ::p/errors* (atom {})
-                        ::p/entity  (atom {:a ::p/reader-error})))
-  (call-parallel-reader {::p/errors* (atom {})
-                         ::p/entity  (atom {:a ::p/reader-error})} :b))
 
 #?(:clj
    (deftest test-parallel

   2 "b"
   3 "c"})

(defresolver 'i->l
  {::pc/input  #{:i}
   ::pc/output [:l]
   ::pc/batch? true}

    (fn [_ i-values]
      (mapv #(hash-map :l (get i->l (:i %))) i-values))))

(defresolver-p 'error
  {::pc/output [:error]}
  (fn [_ _]
    (throw (ex-info "Error" {}))))

(defresolver-p 'error-batch
  {::pc/input  #{:i}
   ::pc/output [:error-batch]
   ::pc/batch? true}
  (fn [_ _]
    (throw (ex-info "Error" {}))))

(defresolver-p 'error->d
  {::pc/input  #{:error}
   ::pc/output [:d]}
  (fn [_ _]
    {:d 3}))

(defresolver-p 'invalid
  {::pc/output [:invalid]}
  (fn [_ _]
    42))
