Fork me on GitHub

@splayemu this still looks strange, what is :user-room/id? did you mean to get the id from the room? if that so, your output should be like: {:room/user {:user/id id}}, makes sense?

Spencer Apple14:10:56

No since I queried into my room table first by :user/id and then by :room/id I concatted the ids into an ident. [:user/id :room/id]. For now I am just using atoms to store my data so the query is just (get-in @room-table [user-id room-id)

Spencer Apple14:10:34

Thank you for all the help understanding pathom!


Hi! is it possible to programmatically generate resolvers? I want to try to generate resolvers from a SQL database using foreign keys to resolve between tables


hmm, judging by what defresolver actually creates it looks like I can just create a #:com.wsscode.pathom.connect{:input ... :output ... :resolve ...} map myself, right? 🙂


A question about query optimization: I have to two tables, user and organization, and each user has an organization_id that links between the two. I’ve set up some basic resolvers and it works great, but it runs two queries: - SELECT ... FROM user WHERE id = ? to get the user data and organization id - SELECT ... FROM organization WHERE id = ? to get the organization data Is it possible to somehow combine these into

FROM user u 
INNER JOIN organization o ON u.organization_id =`
I have tables that are linked like this “N steps”, and it would be fantastic if I could combine it into one query with “N” joins instead of “N” separate queries.


I looked at batch resolvers, am I correct that they are more for avoiding multiple calls when you have multiple results from your query, rather than avoiding joins?


and btw, can I just say that Pathom is absolutely amazing 🤯

👍 4

One more question: is it possible in a resolver to know which outputs are requested? For example, I have a resolver that provides all the data in a table using SELECT * FROM .... But often you only need one or two outputs from a resolver to fulfill the query, and it would be more efficient to do SELECT column1, column2 FROM ... instead. But I couldn’t find anything in the env that say “this is the data I need from the outputs to fulfill the this specific query”, is there such a thing?


are you looking for :com.wsscode.pathom.core/parent-query in resolver's input env?

👍 4

and sorry for the wall of questions 😅


@schmee you may be interested in Walkable, which uses Pathom to fetch data from SQL databases:


I gave it a run earlier, but it lacks some things that I need: - no resolver support, so you have to explicitly specify your “N” joins in your queries (dealbreaker for me) - no optimization like the one I described above: it does one query per table


Thank you for sharing your experience with Walkable! I haven’t used it yet, so this is helpful

👍 4