Fork me on GitHub

@tony.kay I seem to be running into the issue again after doing a df/load-action where I update my global state via post-mutation and the UI isn’t updating


I fixed this elsewhere by doing the same mutation onChange and onBlur


any ideas on how to force re-render?


The rendering should just be a matter of listing what data changed in your :refresh list


I’m pretty sure post mutations also allow a declarative refresh on the mutation itself.

Chris O’Donnell22:04:21

I'm trying to do a bit of ast manipulation for a remote call and am baffled by the result; would love some help. Here's my mutation:

(defmutation set-current-user
  [{::user/keys [id] :as user}]
  (action [{:keys [state]}]
    (let [user-ident [::user/id id]]
      (swap! state #(-> %
                        (assoc-in user-ident user)
                        (assoc-in [:current-user :singleton] user-ident)))))
  (remote [{:keys [ast]}]
    (fp/query->ast `[{(type/insert-user ~{:objects [user]
                                          :on-conflict {:constraint 'user_pkey
                                                        :update-columns '[id email]}})
When I run a transaction with this mutation, I get this error: INTERNAL ERROR: split-mutations was asked to split a tx that contained things other than mutations. [[{(little-gift-list.type/insert-user {:objects [{:little-gift-list.type.user/id #uuid "uuid redacted", :little-gift-list.type.user/email ""}], :on-conflict {:constraint user_pkey, :update-columns [id email]}}) [{:little-gift-list.type/returning [:little-gift-list.type.user/id]}]}]]. The transaction in the error message is wrapped in a vector, which seems to be causing the problem. I'm just not sure why that's happening. Any ideas?


@codonnell you want prim/query->ast1


a mutation is a node of an ast…`query->ast` returns an AST tree with children


also, you might want to leverage returning if you want the result auto-merged

Chris O’Donnell23:04:37

Thanks. 👍 Don't think I need returning here, since I'm already transacting what I need in the local action. The ::type/returning bit is just there to satisfy the schema of the graphql API I'm hitting.

Chris O’Donnell23:04:39

@tony.kay should the example at be using prim/query->ast1 then?


I think so…let me know if that works for you so we’re sure I’m not mis-remembering myself 🙂


if so, let me know and I’ll fix the typo

Chris O’Donnell23:04:59

Yeah, it works with prim/query->ast1