This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-27
Channels
- # announcements (3)
- # babashka (16)
- # beginners (177)
- # calva (102)
- # cider (2)
- # clj-kondo (12)
- # clojars (10)
- # clojure (91)
- # clojure-argentina (3)
- # clojure-australia (5)
- # clojure-europe (16)
- # clojure-nl (1)
- # clojure-uk (10)
- # clojurescript (73)
- # community-development (8)
- # cursive (9)
- # depstar (7)
- # fulcro (5)
- # helix (1)
- # introduce-yourself (1)
- # jobs-discuss (18)
- # lsp (32)
- # luminus (1)
- # malli (2)
- # music (4)
- # off-topic (20)
- # pathom (19)
- # polylith (15)
- # re-frame (4)
- # reagent (6)
- # ring (13)
- # sci (36)
- # shadow-cljs (7)
- # spacemacs (4)
- # sql (3)
- # tools-deps (112)
- # vim (21)
@U0CL38MU1 includes the fix for that batch cache case
Congrats on the release! I don't think ::pco/transform
is documented in the Pathom 3 docs. At least, I couldn't find it with a simple search
well noted, it really isn't, adding to the todolist 🙂
No rest... 🙂 Thanks!
deploying https://github.com/wilkerlucio/pathom3-docs/commit/abc933a3d141277c08a476dc51d2ca15de1c5118
Oh! This is awesome and I think I have a use case for it in my current project
the example was wrong, publishing a fix now
I’m trying to puzzle out why an “N+1” query is happening, despite writing a batch resolver (holy cow, I just saw how batch-transforms
now makes it easier to write batch code. Nice!!! I can’t wait to get rid of all those (if (sequential? input))
from code! 🙂
I have the following resolvers to 1) fetch list of all Trello boards, and 2) fetch all the lists associated with each board.
(pc/defresolver trello-boards [env input]
{;::pc/input #{:trello/board-id}
::pc/output [{:trello/boards
[:trello-board/id :trello-board/name :trello-board/starred
:trello-board/lists]}]})
(pc/defresolver trello-board-lists [env input]
{::pc/input #{:trello-board/id}
::pc/output [:trello-board/id
{:trello-board/lists
[:trello-list/id :trello-list/name :trello-list/board-id
:trello-list/pos]}]}
::pc/batch? true})
When I execute this query, the trello-board-lists resolver is only called with maps, never sequentials, so the lists are always fetched sequentially, not in parallel. Does anyone have any advice on how I can make sure that resolver is called in a way that always triggers batching? Thank you!
[{:trello/boards
[:trello-board/id :trello-board/name :trello-board/lists]}]
Ah, I meant to say more explicitly “thank you, @U066U8JQJ” for the batch-transform
feature. Lovely!
thanks @U6VPZS1EK 🙂. this was also simplified in Pathom 3, there batch resolvers always get a sequence (never a single entry)
not sure if I understand your case in full, but in Pathom 2 there is a limitation in batch, it only works when the items are an immediate sequence, (like, the item directly under some collection)
if there is a more than 1 level separating the list from the batch attribute, it doesn't work
this was also fixed in Pathom 3, where it doesn't care at all about this kind of structure, and can batch across any different points of the query
Thank you! A wonderfully simple explanation! (I’ll rewrite the query. But now I’m curious about what @U0CKQ19AQ’s plans are on whether / when Pathom 3 migration may happen.) Onwards! 🙂
for Fulcro users it should be a simple change in terms of swiping one from the other, for Fulcro all that matters is a EQL engine to fulfill the requests. the work will be migrating the current implementation on the server to use Pathom 3 things, but on the client the changes should be trivial
(I already have a couple of toy projects using Fulcro and Pathom 3 that I do for experimentation)