Fork me on GitHub
#fulcro
<
2019-08-06
>
souenzzo12:08:35

Using: fulcrologic/fulcro {:mvn/version "2.8.12"} Error: [2676.435s] [fulcro.client.impl.application] INTERNAL ERROR: split-mutations was asked to split a tx that contained things other than mutations. - despite the error, the application works It occurs when I return a query without a mutation from a mutation

(fm/defmutation goto-page-42
                [_]
                (action [{:keys [state]}] (swap! ...))
                (remote [{:keys [ast state]}]
                        (-> (fp/get-query Page42)
                            (eql/focus-subquery [:>/page-data])
                            (eql/query->ast1)
                            ;; will result in something like
                            ;; [{:app.user/me (fp/get-query Page42)}]
                            (assoc :dispatch-key :app.user/me
                                   :key :app.user/me))))
Questions: 1- Is wrong return a "query" from a mutation? 2- in fulcro3 it will be suported? 3- should I have a "dummy" mutation on server to handle this?

wilkerlucio13:08:16

@souenzzo are you triggering a mutation but using a property key when sending to the server?

wilkerlucio13:08:49

any reason for not using a load instead?

souenzzo14:08:36

When I call goto-page-42 i need to - swap! client state to this page - load data from server df/load can't do that.

souenzzo15:08:26

I usually use a "empty mutation" on server But this solution looks cleaner

tony.kay15:08:33

@souenzzo You answers are: 1. In fulcro 2, it is wrong to return a query from a mutation. Use load-action instead. 2. Yes, Fulcro 3 is completely open on this front, though I think I still have a limitation that a mutation cannot return an AST of multiple mutations for a remote (can’t change one mutation into many at the mutation level, at least) 3. You could, but load-action is better.

✔️ 4