Fork me on GitHub
#pathom
<
2020-08-03
>
lgessler21:08:29

Is there some config I need to set up for a defmutation for its output? If my mutation errors, I want to return a map with the keys :server/error and :server/message but by the time pathom's response gets to ring I see that the map is empty. do keys in mutation return values get trimmed somehow?

lgessler21:08:57

OK, so I was triggering the mutation using uism/trigger-remote-mutation with the ::m/returning option set--getting rid of ::m/returning resolved this issue for me. still surprised this happened, though, since as far as i can tell using the ::m/returning option didn't change the tx being sent over the wire to pathom

wilkerlucio15:08:04

hello, when you use returning Fulcro does change the query it sends to Pathom, it adds a join on the mutation call, so you get the data, I believe the problem you are having is that, because you have a join query on the mutation, that join query may not have the ::server/error keys, so pathom will strip those out of the response (because the request didn't mentioned it)

wilkerlucio15:08:20

the simplest fix is to add those keys to the component you are using the returning with

wilkerlucio15:08:57

or add a config to pathom to always spit out those keys using mutation join globals: https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/connect-mutations.html#_mutation_join_globals

lgessler15:08:03

makes sense, thank you!