pathom

:pathom: https://github.com/wilkerlucio/pathom/ & https://pathom3.wsscode.com & https://roamresearch.com/#/app/wsscode
lgessler 2020-08-03T21:00:29.392300Z

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?

wilkerlucio 2020-08-04T15:10:04.393300Z

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)

wilkerlucio 2020-08-04T15:10:20.393500Z

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

wilkerlucio 2020-08-04T15:11:57.393700Z

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

lgessler 2020-08-04T15:27:03.393900Z

makes sense, thank you!

lgessler 2020-08-03T21:04:57.392400Z

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