Fork me on GitHub
#pathom
<
2023-03-16
>
Jakub Holý (HolyJak)17:03:50

Hello! Is it possible to make a resolver that uses among others a parent entity property as it s input? In particular, I have Orders that contain OrderLines and want to make a resolver as fn (OrderLine, Order) -> user-friendly text. So I need something like

::pco/input [{:order-line/product [:product/name]} :MAGIC.order/description]
Typically I never care about order lines on their own, only about order lines together with their order, so order will always be in the context already when I enter my resolver. How would you solve it? Thank you!

wilkerlucio17:03:56

hello, you cant look up, thats kind of hard restriction, but you can always push data down. the resolver that computes the order line items knows the order id, so what you can do is add to each order item the order id, that way you will have enough information to request things about that order at that level, makes sense?