Are there polymorphic options in Pathom3 for resolvers to dispatch on values rather than keys (i.e. instead of union resolvers)?
Oh my gosh, apparently I’ve asked this before 🤦♂️: https://clojurians.slack.com/archives/C87NB2CFN/p1669921272838849
@caleb.macdonaldblack #3 is really creative. I like that.
*marks early December 2024 for the next iteration of the question
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.