;; instead of having a resolver with this input
{:input [:person/age
:person/name
{:person/pet [:pet/species
:pet/n-legs]}]}
;; you could have this plain function which calls regular functions to get its
;; input, each of which only need a single entity ID for their input
(defn get-person-stuff [db person-id]
(let [age (get-person-age db person-id)
name (get-person-name db person-id)
pet-id (get-person-pet db person-id)
pet-species (get-pet-species db pet-id)
pet-n-legs (get-pet-n-legs db pet-id)]
...))
And you know, I think that would be workable, even though it feels more boilerplatey to me. It would still get you the main benefit of not having to keep track of all the data shapes that are needed by the functions you're calling etc. Some off-the-cuff thoughts:
Working at https://tyba.ai
Building https://yakread.com and https://biffweb.com
email: [email protected]