fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
Casey 2021-03-12T09:49:23.277900Z

When using datomic/datascript with fulcro+pathom, how do you ellide over the :db/ids in relationships? For example :person/pet is a :db.cardinality/one :db.type/ref, and a pet has a :pet/id uuid which is of course distinct from the pet entity's :db/id . But the pull query in the person-resolver returns {... :person/pet 2 ... } where 2 is the db/id of the pet. But the pet-resolver expects :pet/id . Do you post-process the response from the pull query to replace 2 with an ident [:pet/id uuid]?

Casey 2021-03-12T09:55:11.278100Z

Pondering this more, I think the way to do it is to not have the person-resolver merely return :person/pet in its bag of attributes but something like {:person/pet [:pet/id]} So person-resolver would use a pull query like [:person/id :person/name {:person/pet [:pet/id]}] .

Casey 2021-03-12T09:57:02.278300Z

hmm and I can put the pull query in a (def person-query [...]) then reuse it in the (d/pull db person-query ..)) as well as the pathom resolver declaration ::pc/output person-query !

🤯 1
Björn Ebbinghaus 2021-03-12T12:45:40.279Z

Wait until you hear about dynamic resolvers in pathom. :-D

lokirrationalis 2021-03-12T14:52:02.284400Z

Another beginner question: When writing an Electron app, I guess you would model the Electron IPC — so the communication between main and renderer process — with pathom as well? At least that’s how I would understand the first section of chapter 10 in the book. And I will have a local-only database in my app (Datascript, it will basically be a music collection pointing to local music files), so I’m wondering if — details aside — it makes sense to have two remotes (for now), one being the Electron main process, the other my background database…?

wilkerlucio 2021-03-12T16:14:48.284500Z

yes, that's a nice architecture to put it

lokirrationalis 2021-03-12T17:22:30.284700Z

Thanks, it certainly helps from time to time to get some external validation when you’re starting out with Fulcro! It feels like I understand more every day now, finally. 🙂

🙂 2