Fork me on GitHub

I'm still trying to make the pathom-viz query editor a standalone app. I notice that the simple-parser-demo card expects a local Pathom parser, but I already have a http server listening for Pathom queries, so I'm trying to make the requests to the server. I think I should update this: to make http requests, but I'm lost, not sure how. Any suggestions?


hello @jlle, from the snippet you sent I'm remembering that the query runner uses a different remote name, that's this pv.query-editor/remote-key, did you tried settings this remote to be your remote?


@wilkerlucio you mean something like

 ( "")}


close, but you have to use the regular fulcro network if you want to use the standard HTTP remote, the pathom-remote is a wrapper to turn local async parsers in remotes


oh, sorry, I just realized it will require some more effort to wrap the http call


there is a problem in the current implementation, you actually have to use an async parser interface to use the network it provides


but its not so bad, you can wrap the remote with a parser interface, which is: [env tx] => channel


let me try to get a demo, that will help updating the docs also


or, do a fetch call from the parser interface


@jlle something like this:


(defn transit-read [x]
  (-> (transit/read (transit/reader :json) x)))

(defn transit-write [x]
  (-> (transit/write (transit/writer :json) x)))

(defn http-request-parser [url]
  (fn [env tx]
      (let [{::p.http/keys [body]}
            (<? (p.http/request {::p.http/driver       p.http.fetch/request-async
                                 ::p.http/url          url
                                 ::p.http/content-type ::p.http/transit+json
                                 ::p.http/method       ::p.http/post
                                 ::p.http/headers      {}
                                 ::p.http/form-params  (transit-write tx)}))]
        (transit-read body)))))

; networking
   (pv.query-editor/client-card-parser (http-request-parser "")))}


@wilkerlucio thanks, it looks better, I see that pathom queries are done to the server 🙂 For some reason the results are not displayed on the card. But I can see the proper response on the chrome devtools network tab. I don't have time now, but I'll try to debug it later