Fork me on GitHub
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/env {...}
     ::p/mutate pc/mutate-async
     ::p/plugin [(pc/connect-plugin {::pc/register my-app-registry})


@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?


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


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.


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


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 😓


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.