Fork me on GitHub
#crux
<
2020-04-29
>
dvingo15:04:49

hello. are there any examples of a pull expression helper on top of crux/entity calls? I have one working for my use cases but I'm interested if there are others

refset16:04:29

Hey - I've not seen anything new recently, but did you already see this pattern of writing pathom resolvers https://github.com/souenzzo/graph-demo/blob/master/src/main/souenzzo/graph_demo/core.clj#L70 ? Perhaps this approach could be made more dynamic somehow

👍 1
refset16:04:13

Are you looking for an alternative to your map-zipper? Or is this separate?

dvingo16:04:38

I haven't seen that example using pathom, thanks!

dvingo16:04:56

This is separate from the map-zipper, just using recursion to implement the datomic pull api

dvingo16:04:31

Looks like for my use case I can let pathom resolve recursive queries as in that example

refset16:04:49

Excellent 🙂 let us know how it goes!

dvingo18:04:54

I hacked together a basic pull helper: https://gist.github.com/dvingo/e912c41a26e06b4d95846567aa2ef941 even if using pathom for the API, I find it helpful to query nested structures from the repl. right now it just basic props, joins, recursive queries and '* props. It also uses stack recursion, but I may look into using trampoline to address that.

😎 2