This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-27
Channels
- # announcements (1)
- # beginners (71)
- # braveandtrue (4)
- # cider (1)
- # cljs-dev (4)
- # cljsrn (8)
- # clojure (111)
- # clojure-italy (5)
- # clojure-spec (22)
- # clojure-uk (8)
- # clojurescript (80)
- # cryogen (14)
- # cursive (7)
- # data-science (1)
- # datomic (25)
- # dirac (1)
- # figwheel-main (4)
- # fulcro (13)
- # incanter (1)
- # off-topic (6)
- # other-languages (3)
- # pathom (11)
- # portkey (5)
- # re-frame (13)
- # reagent (3)
- # reitit (24)
- # ring-swagger (7)
- # shadow-cljs (63)
- # spacemacs (3)
- # specter (4)
- # tools-deps (9)
I tried to use p/elide-not-found
as a reader and failed. Now using in the right way. But i think that I can do the same faster with #specter
@souenzzo yes, you should use the p/elide-not-found
in combination with the p/post-process-plugin
looks like this: (p/post-process-parser-plugin (p/elide-not-found))
in the ::p/plugins
list
So @wilkerlucio my parser looks like this, I added the ::pc/mutation-join-globals
key
(def parser
(p/parser
{::p/mutate server/server-mutate
::p/plugins [(p/env-wrap-plugin (fn [env]
(assoc env ::pc/indexes @indexes)))
(p/env-plugin {::p/reader [p/map-reader
pc/all-readers
(p/placeholder-reader ">")]
::p/placeholder-prefixes #{">"}
::pc/mutation-join-globals [::prim/tempids]
::pc/resolver-dispatch resolver-fn})
p/request-cache-plugin
pp/profile-plugin
(preprocess-parser-plugin log-requests)
(preprocess-parser-plugin add-current-info)
(p/post-process-parser-plugin p/elide-not-found)]}))
and my mutation looks like this
(defmutation new-wash
[{:keys [wash-id]}]
(with [env] s.policy/existence)
(action [{:keys [db conn current/firm current/user]}]
(let [db-id (wash/create conn {:org-id (:db/id firm)
:user-id (:db/id user)})]
{::prim/tempids {wash-id db-id}})))
but the tempid remapping is still not happening
@currentoor I'm not using this in quite a time, so it's possible there is a bug, I'm currently updating the code in the docs, I can double check and get back to you if it's working properly there
oh ok, thanks
@currentoor I just tried running hte book code, it seems to work there, at least in terms of data return, can you check on inspect if the tempids key is been returned from the network call?