Fork me on GitHub

Im trying to learn pathom by building a simple CRUD api, and I wonder what is the pattern (if there is one) on what is returned on mutations? should I return on update/create?


usually you can return the map of the just created entity, so the user can read from it if desired


Consider a schema where a "user" has a "cart" When the user call (create-cart {}), I would return

(pc/defmutation create-card ....
   {:user/id ...
    :cart/id ...})
Then, the frontend can call both: [{(create-cart {}) [:user/name {:user/cart [:cart/id :cart/empty?]}]}] [{(create-cart {}) [:cart/id :cart/empty?]}]


IMHO, one of the main points of pathom/graph API's is that you don't need to think about "what to return"

thanks3 3