Fork me on GitHub
#pathom
<
2019-05-11
>
eoliphant20:05:51

Hi, I’m adding pathom to an existing datomic project where the entities are essentially ‘duck typed’, so just the internal :db/id, and external UUID :entity/id, and the code determines if you’re a person (or a duck) based on the presence of certian attributes. Trying to figure out the best way to handle lookup resolvers, where I want say a ‘person’ of entity/id XXX.

hmaurer20:05:09

@eoliphant fetch the entity with id XXX, check if it’s a person, and return nothing if not?

wilkerlucio21:05:01

@eoliphant think in terms of lookup range, having a more specific name gives you more information, its same as :id vs :customer/id

hmaurer21:05:38

ah sorry, I misunderstood your question 😬

eoliphant21:05:39

yeah I was just trying to think of ways to make it work ‘as is’ 🙂. From the pathom perspective, I think that might be inefficient right? If I have person, duck, foo, etc resolvers? if it keeps checking then discarding them. But, ah hell. it would still possibly work based on the fields you ask for right? If my person resolver takes :entity/id, but outputs :person/name …, pathom would find the right one if I ask for {:entity/id XXX [:person/name ...]}

eoliphant21:05:15

but yeah I can always add the ‘typing’ attributes