pathom

2024-03-28T13:40:06.484819Z

Hello everyone! Is there a way to pass params to a nested resolver?

wilkerlucio 2024-03-31T16:37:49.679749Z

hello, can you give an example of what you are looking for?

2024-04-02T07:22:06.509059Z

Sure! I have a resolver that returns :acme/companies That resolver's input is :acme/company-reponses though, which is an output of another resolver that actually does the network request (I followed one of the tutorials on Pathom's website). The "client" calls Pathom to get :acme/companies but there's a bit of information that the "client" has that the network request needs. Let's call it extra-fields. So if the client passed extra-fields as a parameter, only the top level resolver - the one that returns :acme/companies will get it. But it would be cool if I can pass it to the :acme/company-responses resolver. The :acme/company-responses resolver is batch, so I could pass the extra-fields as part of every input item but that's not idea because the extra-fields are shared for all the inputs so I'll be repeating the same extra-fields which is error-prone and kinda looks not optimal.

2024-04-02T07:22:45.485009Z

As a workaround I've combined the two resolvers for now 😞 Which is a petty because I liked to have networking resolver separate - makes it easier to test the non-networking resolver separately.