pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
souenzzo 2020-11-04T11:26:44.259Z

@lilactown I would like this:

(pc/defresolver pet-pull
  [_ _]
  {::pc/input #{:pet/id}
   ::pc/output [:pet/id :pet/name :pet/age ,,,]
  ...)
(pc/defresolver owner-pull
  [_ _]
  {::pc/input #{:owner/id}
   ::pc/output [:owner/id :owner/name :owner/age ,,,]}
  ...)
(pc/defresolver pet-owner
  [_ _]
  {::pc/input #{:pet/id}
   ::pc/output [:owner/id]}
  ...)

(pc/defresolver owner-pets
  [_ _]
  {::pc/input #{:owner/id}
   ::pc/output [{:owner/pets [:pet/id]}]}
  ...)

[{[:pet/id 123] 
  [:pet/id 
   :pet/name 
   {:>/owner [:owner/id
              :owner/name]}]}]

wilkerlucio 2020-11-04T14:12:55.260500Z

@lilactown I would go close with @souenzzo suggestion, when you wrap the result in things like [{:pet [:pet/id :pet/name :pet/age ,,,]}] you miss out on some connection leverage between the attributes, because of the nesting

wilkerlucio 2020-11-04T14:15:37.261400Z

but the alias is also a good option, and keeps the data easier to reason (you can see the alias going on)