This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-01
Channels
- # aleph (1)
- # announcements (2)
- # aws (3)
- # bangalore-clj (1)
- # beginners (136)
- # boot (3)
- # calva (89)
- # cider (44)
- # cljdoc (1)
- # cljs-dev (31)
- # clojure (101)
- # clojure-europe (3)
- # clojure-italy (52)
- # clojure-nl (7)
- # clojure-spec (12)
- # clojure-uk (34)
- # clojurescript (62)
- # community-development (46)
- # cursive (25)
- # datomic (6)
- # duct (26)
- # events (6)
- # figwheel-main (4)
- # fulcro (25)
- # graphql (2)
- # jackdaw (4)
- # jukebox (3)
- # kaocha (57)
- # leiningen (31)
- # off-topic (3)
- # onyx (4)
- # other-languages (22)
- # pathom (18)
- # re-frame (9)
- # reitit (3)
- # shadow-cljs (60)
- # spacemacs (9)
- # speculative (22)
- # sql (39)
- # tools-deps (45)
- # vim (37)
[com.wsscode/pathom "2.2.9"]
is out! For everyone using Pathom I highly suggest to upgrade, this version has some fixes we encountered recently to calculate paths on some complex situations (where it goes from one to many and back, hard to explain but better have it working properly). This also adds p/pre-process-plugin
.
@ecaspary welcome 🙂 about recursive queries, yes they are supported, there is not much you have to do, they should work out of the box even you a valid recursive link in your resolvers, your example looks almost correct, but the :node/neighbors
will not work that way
it can be fixed using:
(def mock-db
{:node/id {0 {:node/id 0 :node/mass 0.00 :node/neighbors [{:node/id 1}]}
1 {:node/id 1 :node/mass 1.11 :node/neighbors [{:node/id 2}]}
2 {:node/id 2 :node/mass 2.22 :node/neighbors [{:node/id 3}]}
3 {:node/id 3 :node/mass 3.33 :node/neighbors [{:node/id 0}]}}})
so the elements are now maps that represent a context, pathom can pick up on that
if I may, you could start simpler to experiment using to-one connections, might be easier to understand at first, to be honest I dont remember trying recursion to many like this
I just tried running it, it works for to-one, but not for to-many, I'm interesting to hear about your case on recursive queries to-many, are those valid in datascript?
so, this works with this mock data:
(def mock-db
{:node/id {0 {:node/id 0 :node/mass 0.00 :node/neighbors {:node/id 1}}
1 {:node/id 1 :node/mass 1.11 :node/neighbors {:node/id 2}}
2 {:node/id 2 :node/mass 2.22 :node/neighbors {:node/id 3}}
3 {:node/id 3 :node/mass 3.33 :node/neighbors {:node/id 0}}}})
but :node/parent
would be a better link name in this case
Is walkable
a somewhat vetted and recommended way of dealing with sql + pathom?
@danielstockton what you mean by vetted?
walkable works fine with pathom, but Walkable doesn't support connect at this stage, so mixing those things don't work well
Just wondering if those that use pathom usually use walkable, and if the two projects are fairly well in agreement (or if there are contentions or overlap)
If they're likely to diverge or significantly overlap, i'd rather pick one
I personally thing the connect infrastructure is what enables the things I create to grow, scale and connect across different sources, but it will depend on the use case, if you have just a lot of SQL maybe use Wakable, but you can use connect and just write resolvers that use some SQL library, and with that you get all the connect features (path resolution, tracer, auto-complete...)
would be great if Wakable did support connect, it could be done, it needs to generate proper connect indexes, and then you could mix both things