Fork me on GitHub
#pathom
<
2019-01-02
>
pauld13:01:21

The pathom dev guide says that pathom-remote will use a pathom async parser. Can I use it with the parallel parser?

pauld14:01:29

It would be nice to have an example of fulcro using pathom. For instance, I don't know how to set the api endpoint and request-middleware without using fulcro's

fulcro-http-remote

pauld15:01:56

Nevermind. I misunderstood. I can keep using fulcro-http-remote as long as I'm using pathom on the server.

wilkerlucio15:01:09

@pauld correct, and about the async and parallel, yes, you can use, the parallel is an async parser

pauld15:01:31

I just got it working!

pauld15:01:56

Just had to use:

(def server-parser #(a/<!! (p/parser % %2)))

pauld15:01:23

I put that in place of the fulcro parser.

pauld21:01:31

Is there a trick to calling a mutation that's defined in a namespace other than the one that has the parser defined?

pauld21:01:42

I get strange errors when I try to do this. On the browser console I get:

java.lang.Exception: Not supported: class java.lang.Class

pauld21:01:58

When I call it from my clojure repl I get:

#:cawala.api.mutations{delete-person
                       #:com.wsscode.pathom.core{:reader-error
                                                 java.lang.NullPointerException}}

pauld22:01:56

I'm not setting ::pc/sym. The app-registry is using

m/delete-person

pauld22:01:28

m is the alias for cawala.api.mutations namespace.

pauld22:01:59

I'm returning nil from the mutation.

pauld22:01:02

It seems to work in my repl when called from the same namespace as my parser via:

`[(delete-person {:list-id 1 :person-id 1})]

pauld22:01:49

that is if I move the definition of delete-person to the same namespace as parser

pauld22:01:06

I suspect my issue may be that I'm using the fulcro's cljs defmutation with pathom's clj defmutation.

pauld22:01:33

Ok I have a solution, not sure if it is the best way. I defined my mutation in the same namespace as parser but defined ::pc/sym to point to my mutations namespace. In that namespace I def'd my mutation by referring to the namespace containing parser.