Fork me on GitHub
#pathom
<
2019-09-19
>
Abhinav Sharma13:09:26

Hi guys, I’ve been exploring the pathom/http/fetch api but having problem translating the clj-http code to the fetch code

(-> (http/request {:method  :get
                     :as      :json
                     :url     requestbin-url})
      :body)


pathom fetch version, I’d only like to extract the resulting :body from this but due to async nature only a channel gets stored in outer var
(go
  (<? (fetch/request-async {::http/url    requestbin-url
                            ::http/as     ::http/json
                            ::http/method "get"})))

Suggestions are welcome 🙂

wilkerlucio14:09:09

@abhi18av that's the nature of async things, if you use pathom async or parallel parser you can return channels and pathom will process, async is contagious (like macros), once there you need to deal with it

wilkerlucio14:09:10

Hello friends, for everyone here that asks, or try to use Pathom with Datomic, I've started working in a plugin to facilitate the integration between those two things: https://github.com/wilkerlucio/pathom-datomic

4
wilkerlucio14:09:43

I personally don't use Pathom with Datomic myself (I'm the middle game business, calling services) so feedback is very appreciated

wilkerlucio14:09:20

currently it can auto-handles queries using :db/id or unique attributes, also helpers to query for entities automatically leveraging user sub-query, full docs on README

wilkerlucio14:09:19

I hope you enjoy 🙂

kszabo14:09:46

we do, thanks for the great update!

eoliphant14:09:15

@wilkerlucio let me know if you need any help on that, we use them together quite a bit

eoliphant15:09:48

just went thru the docs, pretty nice stuff 🙂

wilkerlucio15:09:49

thanks, for now would be great if you can try it out, and find the gaps/problems so we can iterate on it

eoliphant15:09:58

I wish the client API supported filter, that’s a pretty cool way to support security

wilkerlucio17:09:55

@eoliphant with the plugin we can have full control, I'm still wondering about ideas to make it, the most obvious are white/black listing for some attributes, @tony.kay other day also gave the idea to have some sort of nav? fn interface, where you get the context and decide if that attribute is allowed or not in that context (so far seems the most extensible idea)

eoliphant22:09:05

yeah that also would work. attributes are easier i guess, but then there’s then need to limit based on ‘ranges’, etc

eoliphant22:09:26

like I can see :person/name but only for entities where some other conditions are met