Fork me on GitHub
#pathom
<
2023-12-11
>
kendall.buchanan18:12:05

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

plus_one 1
kendall.buchanan20:12:44

Oh my gosh, apparently I’ve asked this before :man-facepalming:: https://clojurians.slack.com/archives/C87NB2CFN/p1669921272838849

imre20:12:52

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

laughcry 1
caleb.macdonaldblack21:12:59

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
kendall.buchanan18:12:29

@U3XCG2GBZ #3 is really creative. I like that.