Fork me on GitHub

when writing pathom resolvers for datomic, is it better to key on the primary key (e.g. uuid) or the internal db/id ? what if the entity has a composite primary key, is it ok to key off that?


I'm curious what others have to say. In my experience, I prefer not to expose internal IDs so I would avoid the datomic I'd and use the generated uuid


Composite keys are interesting. You can certainly model them using Pathom. There is some question around how to expose that data in external facing Pathom API


great, thanks for the feedback. think i'll go with uuid.


+1 for domain/biz/etc id’s instead of :db/id. Pathom and Datomic are a match made in heaven, EQL all the way down (more or less), but :db/id’s have always felt a little leaky to me


Is there a way to ask pathom to give me "everything" that can be reached via joins on a certain entity? E.g, if I have an entity type a with :a/b as a join, and b with b/c as a join, I'd want results like {[:a/id ...] {:a/id ... :a/b {:b/id ... :b/c {...}}}} given a query like [{[:a/id ...] ???}] . I feel silly asking, since I know pathom's all about specific queries yielding specific data, but I'm feeling lazy


I know the * special query symbol is available for a particular entity, i guess i'm looking for a recursive version of that


you could try:

[{[:a/id 1] [* {:a/b [* {:b/c [*]}]}]}]

👍 2

I think fundamentally pathom will not traverse joins unless explicitly asked


yeah... the problem here is that I have joins of unknown depth/type. No biggie, I should just write some code 🙂


no feature for that yet, in Pathom 3, a good way to explore data you don't know is using smart maps + datafy

👍 2

if you do this combo, you can use tools like Portal, Reveal or REBL to navigate the structure

👍 2

is your usage for exploration or to make something prod-like?


prod-like: there's a tree I want to emit that has an unknown (user-created) structure. I think I wanted this facility to help me tinker with stuff in the REPL while I'm developing without writing a giant EQL query, but for actual prod code I don't think this is something I need, and for dev I can just write a function in my dev ns to help with the query


@wilkerlucio is meant for public use? going to polish up and release my pathom-based depenedncy injection framework, think it's pretty good at this point and was wondering if I can make use of this


hello, feel free to use, I'm not decided if I'm going to continue or not this library, but so far I see no other option for map-driven logs that works on both CLJ and CLJS, would love to use mulog, but it doesn't work in CLJS