Fork me on GitHub
#pathom
<
2021-10-18
>
mauricio.szabo14:10:36

Hi there! I'm having trouble figuring out if I can handle a case of a resolver returning multiple inputs. So, the idea is: I have a resolver that supposedly return :user/login and :user/password for example. I want it to return an array - is it possible? Instead of returning a map with both attributes, return a vector of maps?

wilkerlucio14:10:32

yes, taht's correct, give it a name and return a vector of maps

wilkerlucio14:10:05

Query looking something like this:

[{:user/find-logins [:user/login :user/password]}]

mauricio.szabo14:10:44

Thanks, I'll try 🙂

dehli19:10:35

From within the process-resolver-error or process-mutation-error plugin can I somehow assoc in an extra key into the response if a certain condition is met? I want to trigger a different codepath post processing if a certain error is triggered and I’m trying to figure out the best way to do this (note I’m using lenient mode) My other thought is that I could iterate through the entire response post-processing and search for the error but this doesn’t seem as clean due to the fact that errors can exist at various paths in the response.

dehli20:10:46

I think I’m going to go the postwalk approach instead, but if there’s a better way I’m all ears 🙂

dehli20:10:36

actually postwalk ended up not being too bad! just had to find instances of ExceptionInfo

wilkerlucio20:10:44

there is also the plugin entry point ::pcr/wrap-resolver-error that you can use

wilkerlucio20:10:08

maybe you can do something around that

wilkerlucio20:10:35

would love to hear if that works, or if it doesn't, why not

dehli20:10:58

oh great! i will give that a shot as well. appreciate it!