This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-26
Channels
- # aleph (5)
- # announcements (9)
- # beginners (115)
- # boot (36)
- # calva (13)
- # cider (4)
- # clara (7)
- # cljs-dev (27)
- # cljsrn (20)
- # clojure (182)
- # clojure-conj (3)
- # clojure-dev (4)
- # clojure-europe (3)
- # clojure-italy (2)
- # clojure-nl (4)
- # clojure-uk (34)
- # clojurebridge (3)
- # clojurescript (19)
- # clojureverse-ops (3)
- # core-typed (1)
- # cursive (12)
- # data-science (3)
- # datomic (16)
- # emacs (9)
- # events (5)
- # figwheel-main (11)
- # fulcro (14)
- # graphql (7)
- # jobs (10)
- # jobs-discuss (6)
- # lein-figwheel (8)
- # leiningen (2)
- # lumo (22)
- # mount (1)
- # nrepl (7)
- # off-topic (69)
- # overtone (17)
- # pathom (3)
- # quil (1)
- # re-frame (5)
- # reagent (23)
- # reitit (6)
- # remote-jobs (1)
- # rewrite-clj (4)
- # ring (38)
- # shadow-cljs (54)
- # sql (9)
- # uncomplicate (5)
- # xtdb (1)
@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
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.
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]}})
[{::type/returning
[::user/id]}]}])))
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
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.
@tony.kay should the example at http://book.fulcrologic.com/#_morphing_mutations 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 🙂
Yeah, it works with prim/query->ast1