pathom

2023-12-11T18:02:05.353269Z

Are there polymorphic options in Pathom3 for resolvers to dispatch on values rather than keys (i.e. instead of union resolvers)?

2
2023-12-11T20:05:44.257919Z

Oh my gosh, apparently I’ve asked this before 🤦‍♂️: https://clojurians.slack.com/archives/C87NB2CFN/p1669921272838849

2023-12-12T18:00:29.057349Z

@caleb.macdonaldblack #3 is really creative. I like that.

imre 2023-12-11T20:55:52.273279Z

*marks early December 2024 for the next iteration of the question

1
caleb.macdonaldblack 2023-12-11T21:23:59.540779Z

Happens to the best of us. Some other solutions that come to mind are: 1. One resolver that converts {:color :red} => {:red true}, and then many resolvers for each color 2. You can also have many color resolvers that all have the same input: [:color]. Each of the resolvers will check if the color value matches its respective color, and when it doesn’t, it returns ::pco/unknown-value. Pathom will try each resolver, one after another, until one returns a value. 3. Similar to 1, you could transform the value into a key before processing it in pathom. 1 & 2 probably won’t get any help from the query planner. 3 probably would though.

🙏 2