fulcro

Book: http://book.fulcrologic.com, Community Resources: https://fulcro-community.github.io/, RAD book at http://book.fulcrologic.com/RAD.html
yubrshen 2021-06-25T04:28:18.273200Z

In my working on Jakub's Fulcro exercise 7, TASK 3, I'm trying to play with some EQL queries. After implementing the resolvers for team, player, address, While [{:teams [:team/id]}] works to get the expected results, but likewise, [{:teams [:player/id]}] yields {:teams [{:player/id :com.wsscode.pathom.core/not-found}]} [{:teams [:address/id]}] yields {:teams [{:address/id :com.wsscode.pathom.core/not-found}]} Here are my implementation the resolvers for player and address repsectively: (defresolver player [_ {id :player/id}] {::pc/input #{:player/id} ::pc/output [:player/id :player/name :player/address]} (case id 1 #:player{:id 1 :name "Luna" :address {:address/id 1}} 2 #:player{:id 2 :name "Sol" :address {:address/id 2}})) (defresolver address [_ {id :address/id}] ; an ident resolver {::pc/input #{:address/id} ::pc/output [:address/id :address/city]} (case id 1 #:address{:id 1 :city "Oslo"} 2 #:address{:id 2 :city "Trondheim"})) What are my mistakes? Thanks!

Jakub Holý 2021-06-28T11:00:53.293200Z

I guess it should be {:teams [{:team/players [:player/address] ]} - you must join on the team's property that actually links to players

🙌 1
yubrshen 2021-06-28T15:11:07.293500Z

Thanks! Yes, the query has to follow the join path (structure): [{:teams [{:team/players [{:player/address [:address/id :address/city]}]}]}]