pathom

Joe R. Smith 2024-02-29T03:50:46.220279Z

With Pathom3, is it possible to have two resolvers that output the same top-level attribute, but return different nested attributes and have one depend on the other? e.g. resolver 1: no input, output: [{:a [:b]}] resolver 2: input: [{:a [:b]}] , output [{:a [:c :d]}] then run a query like: [{:a [:d]}] and expect it to call resolver1 and then resolver2? From my experimentation the answer appears to be "no".

Thomas Moerman 2024-02-29T14:53:49.643109Z

can you reformulate resolver 2 having input [:b] instead of [{:a [:b]}]?

wilkerlucio 2024-03-01T12:41:49.002219Z

no, because you can only resolve that upper version of :a once

✅ 1
wilkerlucio 2024-03-01T20:47:05.916759Z

but it’s worth noting that if you have multiple different nested provision, Pathom will try to evaluate which of those are better suited to fulfill the whole requirements, considering everything that’s requested under that sub path

wilkerlucio 2024-03-01T20:47:19.549509Z

If none of the paths can fulfill it, it will consider that problem and throw

👍 1