Fork me on GitHub

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.


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


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


ah sorry, I misunderstood your question 😬


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 ...]}


but yeah I can always add the ‘typing’ attributes