Hey all, i'm trying simple stuff but i'm struggling. I just want a list of entities that I can retrieve with a global resolver: Example below. Am I on the right track ? Really a tought time with the syntax also, query are one vector, two vectors or maps in vector... who knows 🤣
Example data :
{:id 1 :when "14.01.24"}
{:id 2 :when "13.01.24"}
{:id 3 :when "12.01.24"}
(pc/defresolver reservation-resolver [env {:keys [id]}]
{::pc/input #{:id}
::pc/output [:when]}
(get-it-from-somewhere id))
(pc/defresolver all-reservations-resolver [_ _]
{::pc/output [:all-reservations]}
{:all-reservations (get-all-of-them)})
Queries :
(pathom-parser {} [:all-reservations])
(pathom-parser {} [[:all-reservations] [:id :when]])(pathom-parser {} [[:all-reservations] [:id :when]]) looks odd.
i think that you are trying to do (pathom-parser {} [{:all-reservations [:id :when]}])
Thanks, yes I got it working and it looks more or less like this :
[{:all-reservations [{:list/reservations [:when]}]}]
and the resolver returns :
{:all-reservations {:list/reservations (get-all-of-them)}}