Fork me on GitHub

[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


Understood, answers all my questions, thanks

👍 5