wilkerlucio / pathom-viz

Visualization tools for Pathom
88 stars 10 forks source link

Support for async processing #63

Closed cyppan closed 3 years ago

cyppan commented 3 years ago

My resolvers return Promesa futures so I can't run my queries in Pathom viz, it would be nice to have the async processor used by default, or at least allow to set a flag or a config.

wilkerlucio commented 3 years ago

Can you clarify this? Pathom does support returning promises on resolvers, you just need to use the async runner. I also do have setups on CLJS and it works ok, I guess there may be a setup issue.

cyppan commented 3 years ago

I mean from the Pathom viz "run query" button, because I get clojure.lang.ExceptionInfo: Resolver my-resolver returned an invalid response: #object[java.util.concurrent.CompletableFuture 0x3957aae2 "pending"] when I click it

wilkerlucio commented 3 years ago

Oh, I see, you are using an async parser in the CLJ side. Sorry, this is my bad on docs, to use Pathom Viz with async on CLJ, you have to tell the connector to do so:

(p.connector/connect-env env {::p.connector/async? true})

Otherwise it assume the CLJ parser is sync.

cyppan commented 3 years ago

Oh yes I'm in Clojure didn't mention that sorry, ok thank you it works now