pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
Thomas Moerman 2020-09-15T10:24:04.034400Z

I was wondering about this too, is calling a parser from within a mutation the correct approach for e.g. resolving some permission keywords that need to be taken into account? Or is there a better approach to resolve some contextual information during a mutation?

henrik 2020-09-15T13:49:42.035800Z

Is it possible to use back navigation in Pathom? (I’m using https://github.com/wilkerlucio/pathom-datomic). I.e.,

[{[:realm.schema/name :u.fluent/task]
  [{:realm.node/_schema
    [:realm/id
     {:realm.node/root [:realm/id]}]}]}]

1💡
henrik 2020-09-15T13:50:23.036600Z

Do I need to install realm.node/_schema manually for it to be recognized perhaps?

henrik 2020-09-16T07:16:48.039900Z

Figured as much @wilkerlucio, creating a manual parser works quite well, so it’d be great to have them generated. We’ll have a look at it and see if we can’t contribute something.

avocade 2020-09-15T14:03:58.037200Z

Or do we need to create manual resolvers for this kind of thing? Would be pretty awesome if the pathom-datomic plugin could just pass that through…

kenny 2020-09-15T14:49:20.037400Z

@thomasmoerman Perhaps your use case is more specific but in our mutations we'll typically return a map that has, at least, a /id attribute that a pathom resolver takes as an input. Pathom will then resolve any additional keys through the regular facilities.

wilkerlucio 2020-09-15T16:15:37.037600Z

no, back references are currently unsupported, if you like to add this I'll take a PR, what needs to change is to also generate the back link properties in the index: https://github.com/wilkerlucio/pathom-datomic/blob/f8a7d25e39cb3be13362eb8016402610f85f8517/test/com/wsscode/pathom/connect/datomic_test.clj#L770-L816

1👍
Thomas Moerman 2020-09-15T18:31:09.037900Z

My case is different: the idea is to call the parser to use the existing resolvers to resolve additional (e.g. permission) info that might prevent the mutation from executing. So it's not a mutation join using an /id return value, as you mention.

avocade 2020-09-15T18:44:53.039500Z

@wilkerlucio thanks for the info! let’s get to work then I guess @henrik 🌟 🚀

kenny 2020-09-15T18:49:41.039700Z

Could you alter the query prior to calling the parser?