Last active
December 2, 2019 22:11
-
-
Save MrEbbinghaus/88d84683a5be5908b854cdfc081fc5eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns decide.server-components.pathom | |
| (:require | |
| [com.wsscode.pathom.connect :as pc] | |
| [com.wsscode.pathom.core :as p])) | |
| (pc/defresolver my-example [_ {r :r}] | |
| {::pc/input #{:r} | |
| ::pc/output [:r | |
| {:x [:r]}]} | |
| (if (< r 5) | |
| {:r r | |
| :x [{:r (inc r)}]} | |
| {:r r})) | |
| ; => #'decide.server-components.pathom/my-example | |
| (def p (p/parallel-parser {::p/env {::p/reader [p/map-reader pc/parallel-reader pc/open-ident-reader]} | |
| ::p/plugins [(pc/connect-plugin {::pc/register [my-example]})]})) | |
| ; => #'decide.server-components.pathom/p | |
| (async/<!! (p {} [{[:r 0] [:r {:x '...}]}])) | |
| ; => | |
| ; {[:r 0] {:r 0, :x [{:r 1, :x [{:r 2, :x [{:r 3, :x [{:r 4, :x [{:r 5, :x :com.wsscode.pathom.core/not-found}]}]}]}]}]}} | |
| (async/<!! (p {} [{[:r 0] [:r {:x 3}]}])) | |
| => | |
| {[:r 0] {:r 0, | |
| :x #error{:cause "Don't know how to create ISeq from: java.lang.Long", | |
| :via [{:type java.lang.IllegalArgumentException, | |
| :message "Don't know how to create ISeq from: java.lang.Long", | |
| :at [clojure.lang.RT seqFrom "RT.java" 557]}], | |
| :trace [[clojure.lang.RT seqFrom "RT.java" 557] | |
| [clojure.lang.RT seq "RT.java" 537] | |
| [clojure.core$seq__5402 invokeStatic "core.clj" 137] | |
| [clojure.core.protocols$seq_reduce invokeStatic "protocols.clj" 24] | |
| [clojure.core.protocols$fn__8136 invokeStatic "protocols.clj" 75] | |
| [clojure.core.protocols$fn__8136 invoke "protocols.clj" 75] | |
| [clojure.core.protocols$fn__8088$G__8083__8101 invoke "protocols.clj" 13] | |
| [clojure.core$transduce invokeStatic "core.clj" 6884] | |
| [clojure.core$into invokeStatic "core.clj" 6899] | |
| [clojure.core$into invoke "core.clj" 6887] | |
| [edn_query_language.core$query__GT_ast invokeStatic "core.cljc" 302] | |
| [edn_query_language.core$query__GT_ast invoke "core.cljc" 295] | |
| [com.wsscode.pathom.core$join_seq_parallel$fn__18611$state_machine__8483__auto____18624$fn__18627 | |
| invoke | |
| "core.cljc" | |
| 436] | |
| [com.wsscode.pathom.core$join_seq_parallel$fn__18611$state_machine__8483__auto____18624 | |
| invoke | |
| "core.cljc" | |
| 432] | |
| [clojure.core.async.impl.ioc_macros$run_state_machine invokeStatic "ioc_macros.clj" 973] | |
| [clojure.core.async.impl.ioc_macros$run_state_machine invoke "ioc_macros.clj" 972] | |
| [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped | |
| invokeStatic | |
| "ioc_macros.clj" | |
| 977] | |
| [clojure.core.async.impl.ioc_macros$run_state_machine_wrapped invoke "ioc_macros.clj" 975] | |
| [com.wsscode.pathom.core$join_seq_parallel$fn__18611 invoke "core.cljc" 432] | |
| [clojure.lang.AFn run "AFn.java" 22] | |
| [java.util.concurrent.ThreadPoolExecutor runWorker "ThreadPoolExecutor.java" 1128] | |
| [java.util.concurrent.ThreadPoolExecutor$Worker run "ThreadPoolExecutor.java" 628] | |
| [clojure.core.async.impl.concurrent$counted_thread_factory$reify__3147$fn__3148 | |
| invoke | |
| "concurrent.clj" | |
| 29] | |
| [clojure.lang.AFn run "AFn.java" 22] | |
| [java.lang.Thread run "Thread.java" 834]]}}} | |
| (p {} [{[:r 0] [:r {:x '...}]}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment