This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-06-10
Channels
- # aleph (4)
- # announcements (27)
- # aws (12)
- # aws-lambda (1)
- # beginners (207)
- # boot (4)
- # calva (8)
- # cider (9)
- # clj-kondo (9)
- # cljs-dev (27)
- # cljsrn (6)
- # clojure (104)
- # clojure-android (3)
- # clojure-dev (9)
- # clojure-finland (2)
- # clojure-italy (18)
- # clojure-spec (8)
- # clojure-uk (100)
- # clojurescript (43)
- # clojutre (1)
- # core-async (49)
- # cursive (18)
- # data-science (3)
- # duct (24)
- # events (2)
- # fulcro (27)
- # immutant (1)
- # off-topic (32)
- # om (2)
- # onyx (2)
- # pathom (14)
- # pedestal (2)
- # planck (3)
- # re-frame (38)
- # reagent (7)
- # reitit (10)
- # rewrite-clj (7)
- # ring-swagger (3)
- # shadow-cljs (32)
- # spacemacs (63)
- # test-check (16)
- # tools-deps (5)
- # vim (21)
kind of slogging through wiring everything together practically. didn’t realize each resolver in a parallel-reader
was going to return a channel, as opposed to the entire parse
call returning a single channel to take the query/mutation result from
@mss in the end you only need to read in the channel that the final parser returns, are you using pathom on the client or in the server?
using it on the server. weird, my parser doesn’t seem to be returning a channel. e.g.
(pathom-connect/defresolver test-resolver [env _]
{::pathom-connect/output [:something/name :something/type]}
(let [{:keys []} env]
{:something/name "hey"
:something/type :something.type/test-type}))
(defn build-parser [config env-entities]
(pathom/parser
{::pathom/env (merge {::pathom/reader [pathom/map-reader
pathom-connect/parallel-reader
pathom-connect/open-ident-reader
pathom/env-placeholder-reader]
::pathom/placeholder-prefixes #{">"}}
env-entities)
::pathom/mutate pathom-connect/mutate-async
::pathom/plugins [(pathom-connect/connect-plugin {::pathom-connect/register [test-resolver]})
pathom/error-handler-plugin
pathom/request-cache-plugin
pathom/trace-plugin]}))
(def my-p (build-parser {} {}))
(clojure.pprint/pprint (my-p {} [:something/name :something/type]))
the above returns:
#:something{:name
#:com.wsscode.pathom.parser{:provides
#{:something/type
:something/name},
:response-stream
#object[clojure.core.async.impl.channels.ManyToManyChannel 0x721582a2 "clojure.core.async.impl.channels.ManyToManyChannel@721582a2"]},
:type
#:com.wsscode.pathom.parser{:provides
#{:something/type
:something/name},
:response-stream
#object[clojure.core.async.impl.channels.ManyToManyChannel 0xca1a4fb "clojure.core.async.impl.channels.ManyToManyChannel@ca1a4fb"]}}
I’m definitely missing or misusing something in my configuration, then. just not clear what. on pathom 2.2.14
@mss the problem is you are using incompatible things
you need to use the p/parallel-parser
to use the parallel reader
they have different processing mechanisms
just replace that, the parser will return a channel, and reading this channel gets you the final response
knew I had something configured incorrectly. thanks for putting this library out. it’s really a joy to use
glad to hear you are enjoying the time with it 🙂