This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-17
Channels
- # announcements (10)
- # aws (10)
- # babashka (11)
- # beginners (77)
- # calva (9)
- # cider (10)
- # cljdoc (7)
- # cljs-dev (47)
- # clojure (47)
- # clojure-uk (4)
- # clojurescript (87)
- # community-development (15)
- # conjure (14)
- # core-async (25)
- # cursive (6)
- # fulcro (6)
- # helix (3)
- # joker (2)
- # nrepl (1)
- # off-topic (1)
- # pathom (9)
- # pedestal (6)
- # re-frame (22)
- # reitit (15)
- # shadow-cljs (26)
- # spacemacs (16)
- # testing (2)
- # tools-deps (12)
- # uncomplicate (10)
- # xtdb (22)
async-parser: {:search [{} {} {}]}
parallel-parser: {:search []}
parser: {:search [{:user/name Jack Sparrow} {:movie/title Ted} {:book/title The Joy of Clojure}]}
So far the only solution I found was to make a reader instead of a resolver:
(def user-notifications
{:user/notifications
(fn [env]
(go-catch
(<! (join-seq-parallel (assoc env
::p/union-path
(fn [{:keys [query] :as env}]
(let [e (p/entity env)]
(:notification/type e))))
n)))))})
@yenda thanks for the report, looking into it now
@yenda fixed by: https://github.com/wilkerlucio/pathom/pull/161 going to release alpha-8
soon
also add new docs on unions + connect: https://wilkerlucio.github.io/pathom/v2/pathom/2.2.0/connect/resolvers.html#_union_queries
nice thanks! There is no solution for when you have a :type key for instance, because there isn't really any field unique to the entity?
you can still use that, by overwriting the ::p/union-path
on the pathom env, this can be a (fn [env])
so you have full control over what branch to pick