pathom

2025-11-02T14:38:24.253179Z

I have a data structure with a recursive parts nested inside. currently I'm embedding it in the env and have a single top-level resolver that outputs a couple of values based on that data structure. my intent is to write all the other resolvers so they descend from those values, without caring where they came from. since the recursive parts have the same shape as the outer structure, my hope is that I can write a resolver with something like {::pco/output [{:nested/subquery [:root/key1 :root/key2]}]} and inside that subquery all the same resolvers will derive from those values of :root/key1 and :root/key2, rather than the top level ones. but it doesn't work like that. If I query the [{:nested/subquery [:root/key1]}], I get the correct values. but if I start adding other keys with resolvers that want :root/key1 as an input, they're getting the top-level :root/key1. is there any way to achieve this kind of "pocket dimension" subquery? my intuition says placeholders with the "provide data" plugin may be the answer, but I haven't found a way to make it work.

2025-11-02T14:40:19.004499Z

I'm trying to distill this into a freestanding, simplified example, but it'll take time.

2025-11-02T15:46:23.535869Z

placeholders don't seem to help on their own... but perhaps making that top-level resolver not technically top-level might work? I can add a dummy key or something as an input.

2025-11-03T04:36:32.287409Z

I think I've got this put together now. the top level resolvers were the main problem. Pathom is happy to use those, rather than any other path from the input entity through some resolvers. (which makes sense! but it is a bit action-at-a-distance that global, zero-input resolvers have this qualitative difference.) A dummy input didn't work, or at least I couldn't get it to work. But I saw a thread from a while ago in this channel talking about putting a deeper tree of data into the input map. I had only been thinking of it as a one level map of parameters, but it's really any rooted subgraph. that's made the difference, and now the nesting is working perfectly.