Fork me on GitHub
#pathom
<
2018-12-18
>
Björn Ebbinghaus18:12:27

@wilkerlucio I have some trouble with the pathom remote for Fulcro. I alway get {:message "Mutation not found", :data {:mutation login}} when I make a mutation like so: [(login {...params...}})] I have used the template setup from the developers guide. What am I doing wrong here? I am getting crazy.

(pc/defmutation login [env {:keys [connection nickname password]}]
  {::pc/sym 'login
   ....})

(def my-app-registry [login])

(def parser
  (p/parallel-parser
    {::p/env {...}
     ::p/mutate pc/mutate-async
     ::p/plugin [(pc/connect-plugin {::pc/register my-app-registry})
                 ...]}))

wilkerlucio19:12:33

@mroerni the issue here I think is because you used a simple symbol to define your mutation, that means it has the fully qualified name whatever-ns-you-have/login instead of just login, I suggest you try namespacing it on the server (maybe user/login), of you use that on the definition then you can use directly

Björn Ebbinghaus19:12:01

Already did that. Same result. ::pc/sym 'dbas/login Is there a way to get all registered mutations?

wilkerlucio19:12:40

you can check on the index, there is ::index-mutations there that should have then all

wilkerlucio19:12:55

I just realized there is no good full example of it, I'm writing one now so I can double check if its all good on that flow and provide an example

Björn Ebbinghaus19:12:32

I am just starting with pathom. I don't fully understand where I get access to the index, yet.

wilkerlucio19:12:49

to access it you need to provide your own, you can use (def index (atom {})) at some place, then provide to connect-plugin as ::pc/indexes index

wilkerlucio19:12:09

when the parser starts it will be mutated with the injected values

Björn Ebbinghaus19:12:27

Oh... Simple mistake.. It is: ::p/plugins not ::p/plugin 😓

wilkerlucio19:12:11

the famous typos 🙂

Björn Ebbinghaus19:12:21

Maybe I should write a spec ...

Björn Ebbinghaus20:12:45

Thank you. 🙂 My code is finally working like intended. After I gave up on my own remote, I realised that PathomRemote is already doing, what I intended to do.