Fork me on GitHub
#fulcro
<
2019-01-22
>
souenzzo12:01:49

I'm trying to do a mutation(client) that sends a query to remote

(m/defmutation page.user/full
  [{:keys [id]}]
  (action [{:keys [state]}] ...)
  (remote [_]
    (fp/query->ast `[{[:user/by-id ~id] ~(fp/get-query FullUser)}])))
But it's throws split-mutations was asked to split a tx that contained things other than mutations There is some way to handle that?

souenzzo12:01:09

df/load inside action seems wrong but works

exit214:01:45

If I wanted to log all mutations that a user performs, is there something I can tap into to do that?

tony.kay16:01:02

@njj Yes. you can use the same hooks that any tool (like inspect) uses. See primitives/register-tool

tony.kay16:01:46

@souenzzo That’s a but too much of a stretch…see returning. You can indicate that the mutation “returns” a specific graph (mutation join), and the query can be arbitrary from there…but you cannot tack on an arbitrary query.

tony.kay16:01:46

Your other alternative is to use load-action in action and remote-load in remote.

tony.kay16:01:02

but you can’t make a mutation both without returning.

souenzzo20:01:45

Fulcro is awesome :grinning_face_with_star_eyes: Normalization finally became my friend and not my nightmare

tony.kay22:01:08

Sounds like an aha moment 🙂

mss21:01:37

playing around with form validation and getting an error FORM NOT NORMALIZED: [:form/by-id "sign-in-form"] when calling form-state/mark-complete! inside my component. my ident/query look like this + form data:

{:ident         [:forms/by-id :form/id]
 :initial-state {:form/id            :sign-in-form
                 :sign-in-form/email ""}
 :query         [:form/id :sign-in-form/email fs/form-config-join]
 :form-fields   #{:sign-in-form/email}}
the call to mark-complete! looks like (transact! this `[(fs/mark-complete! {:field :sign-in-form/email})]) any idea what I might be doing wrong here? looks normalized in my app db

j1mr10rd4n22:01:54

semantic-ui-wrappers/2.0.5-SNAPSHOT is up on clojars - feedback welcome before 2.0.5 release… it updates semantic-ui-react to version 0.84.0 and introduces some optimisations that shadow-cljs projects can take advantage of to reduce build sizes