This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-08
Channels
- # announcements (22)
- # aws (4)
- # babashka (25)
- # beginners (78)
- # calva (9)
- # cider (22)
- # cljdoc (2)
- # cljsrn (2)
- # clojure (27)
- # clojure-australia (7)
- # clojure-europe (22)
- # clojure-nl (15)
- # clojure-uk (26)
- # clojurescript (20)
- # datahike (3)
- # datomic (15)
- # events (1)
- # helix (5)
- # honeysql (4)
- # kaocha (1)
- # malli (1)
- # meander (1)
- # off-topic (84)
- # pathom (14)
- # re-frame (3)
- # reagent (28)
- # reitit (6)
- # sci (1)
- # shadow-cljs (78)
- # tools-deps (30)
hi, I'm having an embarrassingly simple issue with pathom 2: it's my first time implementing a to-many join in my resolvers, and I'm getting an error Don't know how to create ISeq from: clojure.lang.Keyword
when pathom attempts to follow the to-many join. I have a declared pc output :foo/to-many-join
, and my output looks like {:foo/id ... :foo/to-many-join [[:bar/id 1] [:bar/id 2]]
. Is there something wrong with the shape of my data for :foo/to-many-join
?
I do have ::pc/open-ident-reader
in my parser's ::p/reader
, which I think is necessary for the ident-style joins
hello, yes, the output shape is wrong, a to-many must have a collection of maps, not idents
this is in contrast with Fulcro, in Fulcro normalized DB it uses the idents to ref things, but that's not how Pathom works
in your case you need to return something like: {:foo/id ... :foo/to-many-join [{:bar/id 1} {:bar/id 2}]
so you have the initial data for pathom to extend on top
follow-up question... before I checked back here for your messages I just finished refactoring my code to use p/parallel-parser
with pc/parallel-reader
and pc/mutate-async
and the fulcro-style ident seems to work?
be careful with parallel parser though, there only a few cases in which its a good option for general users
most of the time is slower and way more complex, not worth until you can really leverage a lot parallelism (measure your cases if you wanna check)