This ^
Does Pathom3 provide the parser in the env? I want to be able to resolve attributes in mutations, and would presumably need access to the parser.
I did some play here, and I checked its possible to also implement a promesa protocol to make other async things fulfill it, here is an example using core.async via said extension:
(extend-type cljs.core.async.impl.channels/ManyToManyChannel
promesa.protocols/IPromiseFactory
(-promise [this]
(p/create
(fn [resolve reject]
(go
(let [v (<! this)]
(if (error? v)
(reject v)
(resolve v))))))))
(comment
(let [start (system-time)]
(-> (p.a.eql/process (pci/register
(pco/resolver 'foo {::pco/output [:foo-async]}
(fn [_ _] (go {:foo-async "the-value"}))))
[:foo-async])
(p/handle (fn [result error]
(println "RES" result error))))))
Pathom 3 just uses the env directly for everything, no need for parser
you can use the env to trigger p.eql/process
from inside the mutation
makes sense?
Yep, thanks
I probably wont provide this in the library to avoid having the dep on core.async at all, but it can be a separated library, or a documentation page with the snippet
what you think?
Good approach. I really like core.async myself but having completablefutures is a good default, especially on the jvm. And it's easy to plug one into the others (you can make completablefuture impl for core. async readport/writeport that follows promise-chan impl, then overhead is really low I guess)
I wouldn't bake in interceptor usage tho, this is more opinionated, there's no standard and there are multiple good impl. in clojure with subtle differences.
1👍