pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
tvaughan 2020-07-21T21:32:53.332Z

What's the canonical way to query for enums in EQL/Pathom? If I have a schema like:

{:db/ident :document/status
  :db/valueType :db.type/ref
  :db/cardinality :db.cardinality/one}
 {:db/ident :document.status/draft}
 {:db/ident :document.status/final}
A query for [:document/status] returns :document/status {:db/id 17592186045468}. I know that with Pathom it's recommend to have separate id's for entities, like :document/id, :person/id, etc. which I do have elsewhere. But entities like these aren't enumerated entities. If there's an EQL compatible way to query for the keyword, I haven't found it. Any help is appreciated. Thanks

eoliphant 2020-07-21T21:38:51.336400Z

this isn’t really a ‘pure’ pathom thing per-se. Just has to do with the fact that while EQL/Pathom are very close, there isn’t always 1-to-1 correspondence with Datomic. so you can either roll your own resolvers for your enum attrs that return the :db/ident value, or check out pathom-datomic that has some special sauce to make this easier. basically you give it your enum attributes at config time, and it does what I described for you

tvaughan 2020-07-21T21:43:22.337200Z

Right, I knew I was conflating the two. Sorry for any confusion. Thanks @eoliphant. I'll check-out pathom-datomic

eoliphant 2020-07-21T21:46:05.339400Z

ah no, not at all. if you can use Datomic in your app, it with Pathom is a match made in heaven lol. Just little stuff like that you have to be aware of. And things just got a bit better with some of the new datomic apis that were just released. qseq and index-pull

tvaughan 2020-07-21T21:48:07.339600Z

Cool. Thanks again!