Fork me on GitHub
#pathom
<
2018-11-24
>
currentoor18:11:01

how do i invoke the parser manually?

wilkerlucio19:11:00

@U09FEH8GN what you mean by invoking the parser manually? the case you describe looks like a simple mutation join

currentoor20:11:38

How do I invoke the parser on a mutation literal outside of Fulcro

wilkerlucio04:11:13

the parser is a function, you can call it directly

wilkerlucio04:11:28

if you are using on the client it will return a channel

wilkerlucio04:11:51

but I'm not following what you need

currentoor18:11:19

for example i have a mutation

[{(ucv.ui.mobile-pos.screens.camera/new-wash-&-unconfirmed-vehicle
   {:file-id #uuid "a4028c1a-efdc-48f5-88aa-c0cf1b3015d3",
    :wash {:wash/id #uuid "53988eca-da63-424c-af8c-f1c67f4c8b26"}})
  [*]}]

currentoor18:11:35

basically i want to connect the pathom parser to my file-upload remote so clients can send post-upload-mutation/reads along with file uploads

mitchelkuijpers21:11:03

Awesome release, the new batch-resolver helper is pretty nifty

wilkerlucio22:11:39

@U060GQK8U glad you enjoyed! there is a cool trick you can use with the new resolver syntax in case you get to it, if you want to use the nice macro syntax and make a batch resolver, you can write it like this:

(pc/defresolver batched-resolver [env items]
  {::pc/input     #{:id}
   ::pc/output    [:id :name]
   ::pc/transform pc/transform-batch-resolver}
  (mapv #(get db (:id %)) items))

mitchelkuijpers09:11:22

Awesome, just changed it, to that. Like that waayyy better

mitchelkuijpers09:11:23

Also found some cases where we can us it ourselves, feels a bit like middleware.. very powerful

wilkerlucio11:11:28

function composition rox 🙂