> The `::pc/params` is currently a non-op
In mutations, to ensure only the desired data is being transacted,
is there a nice way to select a shape from params
?
shape described with clojure.spec or EQL maybe
I dont know if it will help, but I wrote a small spec plugin for params once: https://github.com/hhucn/decide/blob/4286fe83303598cc831add58319ee2d631981cac/src/main/decide/server_components/pathom.clj#L52
(def spec-plugin
{::p/wrap-mutate
(fn [mutate]
(fn [env sym params]
(if-let [spec (get-in env [::pc/indexes ::pc/index-mutations sym ::s/params])]
(if (s/valid? spec params)
(mutate env sym params)
(do
(log/warn (s/explain-str spec params))
(throw (ex-info "Failed validation!" (s/explain-data spec params)))))
(mutate env sym params))))})