pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
thheller 2020-11-12T11:32:52.290Z

hey I was just going over the pathom3 docs and noticed that env is quite often missing from the examples. I don't think its actually optional right? https://pathom3.wsscode.com/docs/resolvers

pithyless 2020-11-12T11:53:43.291900Z

@thheller it looks like a multi-arity function in pathom3; with one arg, env is {} ; with zero args both env and input default to {}

๐Ÿ‘ 1
โ˜๏ธ 1
wilkerlucio 2020-11-12T13:29:32.293Z

@thheller @pithyless this is also ported on latest versions of pathom 2, the multi arity thing for defresolver

๐Ÿ‘ 1
pithyless 2020-11-12T14:41:07.294900Z

@wilkerlucio I know it's rude to ask for ETAs, but are mutations for pathom3 on the roadmap short-term or long-term? If it's not planned for the short-term, I may just try playing with a hybrid approach (trying out P3 resolvers and smart-maps and P2 mutations).

souenzzo 2020-11-12T17:21:06.296700Z

@pithyless why move into p3? I'm using p2 with all new features backported from p3 p3 still miss things like placeholders, which it my main "blocking" feature

pithyless 2020-11-12T17:54:00.297200Z

I'm interested in some of the new user APIs; like the smart-maps interface and lack of explicit parsers. And I'd like to see if I can re-use some of the graph introspection logic for a slightly different use-case (which probably would be easier to base off of the new internals). But didn't know about placeholders; I guess that's enough reason to keep using p2 for existing code and only use p3 for the more experimental stuff. Thanks for the heads up!

souenzzo 2020-11-12T18:09:20.297400Z

(let [parser (p/parser {::p/plugins [(pc/connect-plugin)
                                     p/error-handler-plugin
                                     p/elide-special-outputs-plugin]
                        ::p/env     {::p/reader               [p/map-reader
                                                               pc/reader2
                                                               pc/open-ident-reader
                                                               p/env-placeholder-reader]
                                     ::p/placeholder-prefixes #{">"}}})
      process (fn [index tx]
                (parser (assoc index
                          ::pc/indexes index)
                        tx))
      index-a-42 (pc/register {} (pc/constantly-resolver :a 42))
      index-dyn-a (pc/register {} (pc/resolver 'a {::pc/output [:a]}
                                               (fn [{:keys [a]} _]
                                                 {:a a})))]
  {"from ctx" (process (assoc index-dyn-a
                         :a 55)
                       [:a])
   "static"   (process index-a-42
                       [:a])})
=> {"from ctx" {:a 55}, "static" {:a 42}}
It's undocumented, but you can decouple indexes from parser in pathom2 ๐Ÿ˜‰

wilkerlucio 2020-11-12T19:32:45.301300Z

hello, no worries, my rough estimation is to have something that I consider โ€œfeatured enoughโ€ to use by the end of this year, and by this I mean reads, mutations, placeholders, batching, telemetry and tooling. prioritization is always tricky, so I may push async later to have something sync funcional first

pithyless 2020-11-12T20:21:09.302Z

Thanks for the clarification; looking forward to the improvements in P3! PS. @wilkerlucio Kudos for all the effort you're putting into EQL with you're writing/tech talks/podcasts/etc; it's important long-term work to get more people thinking critically about graphs and data-modeling.

๐Ÿ’ฏ 4
๐Ÿ‘ 2
๐Ÿ™ 3