Fork me on GitHub
#pathom
<
2021-02-21
>
dehli19:02:50

Should throwing an exception from within a wrap-mutate plugin surface as a mutation error? It seems that the error is being swallowed somewhere.

wilkerlucio21:02:31

ir should surface as a error value on the mutation response

👍 3
dehli02:02:53

I think I’ve figured out what was causing my issue. I have a mutation that’s properly surfacing the error (from the plugin) when I call it regularly. However, if I specify keys to return from the mutation it’s resulting in the error not surfacing.

(pco/defmutation mutate [params]
  {::plugins/params-spec (ds/spec ::spec {::id keyword?})}
  {::params params})

(p.a.eql/process registry `[(mutate {::id "fail")])
;; Returns with a ::pcr/mutation-error

(p.a.eql/process registry `[{(mutate {::id "fail"}) [::params]}])
;; Returns {`mutate {}}
I added a failing test showcasing the difference in behavior in case that’s helpful. https://github.com/dehli/pathom3-plugins/blob/main/test/dehli/pathom3/plugins_test.cljc#L25-L33

wilkerlucio12:02:00

hello @U2U78HT5G, I found the issue on the part that filters the output, that was swallowing the error, fixed on master

wilkerlucio12:02:12

on top of that, a few things I like to suggest after looking at your code:

wilkerlucio12:02:17

- No need to provide plugin-id when using defplugin - p.a.eql alias should be used for async EQL, for sync it should be p.eql

dehli13:02:49

Awesome, I’ll pull down latest! Also thanks for the suggestions! That’ll clean up the code!

wilkerlucio13:02:21

oh, since you were so fast

wilkerlucio13:02:27

I acutally pushed a bug, but just fixed

wilkerlucio13:02:36

c50d2e75dd084190c58c0e5a599c8e3f1a88d9ef should be fine

dehli13:02:18

Perfect! Will use that SHA 🙂

dehli13:02:46

Just validated that the fix worked as expected. Thanks for the quick fix!

👍 3