This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-11-04
Channels
- # announcements (4)
- # babashka (15)
- # beginners (147)
- # bristol-clojurians (8)
- # calva (6)
- # chlorine-clover (39)
- # clj-kondo (29)
- # clojure (95)
- # clojure-australia (1)
- # clojure-berlin (1)
- # clojure-europe (24)
- # clojure-nl (3)
- # clojure-spec (185)
- # clojure-uk (98)
- # clojured (2)
- # conjure (3)
- # core-async (26)
- # datomic (11)
- # etaoin (1)
- # events (1)
- # fulcro (26)
- # graalvm (3)
- # graphql (4)
- # jobs (7)
- # jobs-discuss (1)
- # kaocha (12)
- # leiningen (21)
- # malli (2)
- # meander (2)
- # parinfer (3)
- # pathom (3)
- # pedestal (5)
- # remote-jobs (2)
- # shadow-cljs (71)
- # spacemacs (2)
- # sql (4)
- # tools-deps (22)
- # tree-sitter (1)
- # vim (2)
- # xtdb (5)
@lilactown I would like this:
(pc/defresolver pet-pull
[_ _]
{::pc/input #{:pet/id}
::pc/output [:pet/id :pet/name :pet/age ,,,]
...)
(pc/defresolver owner-pull
[_ _]
{::pc/input #{:owner/id}
::pc/output [:owner/id :owner/name :owner/age ,,,]}
...)
(pc/defresolver pet-owner
[_ _]
{::pc/input #{:pet/id}
::pc/output [:owner/id]}
...)
(pc/defresolver owner-pets
[_ _]
{::pc/input #{:owner/id}
::pc/output [{:owner/pets [:pet/id]}]}
...)
[{[:pet/id 123]
[:pet/id
:pet/name
{:>/owner [:owner/id
:owner/name]}]}]
@lilactown I would go close with @souenzzo suggestion, when you wrap the result in things like [{:pet [:pet/id :pet/name :pet/age ,,,]}]
you miss out on some connection leverage between the attributes, because of the nesting
but the alias is also a good option, and keeps the data easier to reason (you can see the alias going on)