This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-30
Channels
- # babashka (46)
- # beginners (234)
- # bristol-clojurians (4)
- # cider (7)
- # clj-kondo (39)
- # cljdoc (8)
- # cljs-dev (10)
- # cljsjs (10)
- # cljsrn (24)
- # clojure (84)
- # clojure-brasil (7)
- # clojure-europe (12)
- # clojure-germany (4)
- # clojure-italy (3)
- # clojure-nl (41)
- # clojure-spec (17)
- # clojure-uk (66)
- # clojurescript (64)
- # conjure (161)
- # cursive (12)
- # data-science (45)
- # datomic (20)
- # devops (11)
- # docker (2)
- # duct (9)
- # events (7)
- # figwheel (1)
- # figwheel-main (20)
- # fulcro (32)
- # graalvm (5)
- # helix (82)
- # jackdaw (9)
- # jobs-discuss (19)
- # kaocha (11)
- # local-first-clojure (1)
- # malli (6)
- # meander (3)
- # nrepl (12)
- # off-topic (2)
- # other-lisps (15)
- # pathom (14)
- # rdf (6)
- # re-frame (8)
- # reactive (1)
- # reagent (5)
- # reitit (4)
- # rum (3)
- # shadow-cljs (77)
- # spacemacs (3)
- # sql (9)
- # test-check (31)
- # tools-deps (13)
- # vim (62)
- # xtdb (18)
Hi a pathom+clojure newbie here trying to learn how to build fulcro+datomic web app. Despite the docs and examples I’m having a hard time why my mutation isn’t found. In the fulcro inspect query I query for
[{(app.models.session/login
{:user/email "asd" :user/password "letmein"})
[:user/token]}]
and get
{app.models.session/login
{:com.wsscode.pathom.core/reader-error
"Mutation not found - {:mutation app.models.session/login}"}}
I looked at archives and saw a tip to the check if its in the index and it seems to be there
(p/env-wrap-plugin (fn [env]
(println "index-mutations" (get-in env
[:com.wsscode.pathom.connect/indexes
:com.wsscode.pathom.connect/index-mutations
'app.models.session/login]))
; index-mutations {:com.wsscode.pathom.connect/sym app.models.session/login, :com.wsscode.pathom.connect/mutate #object[app.models.session$login__34847 0x347d0002 app.models.session$login__34847@347d0002], :com.wsscode.pathom.connect/output [:user/token]}
(let [conn (app.database/get-connection)]
(assoc env
:db (d/db conn)
:conn conn))))
I tried using ::pc/sym ’login and ::pc/sym ’user/login but I keep getting the same error. I’ll keep going through the docs and examples, but I don’t know what to try next.@koivistoinen.tuomas IIRC there was a bug in Inspect with mutations-not-found in the Query tab. have you tried calling Pathom parser directly from the REPL?
it’s actually pretty easy: parser is just a function which takes env
and tx
if you’re using fulcro-template then the only external thing in the env
is ring/request
which you can put there by hand (if you really need to i.e. if your resolvers/mutations depend on it), otherwise it’s just (parser {} [{(your-mutation {:param 1}) [:data]}])
Huge thanks it works! I struggled a while with an invalid expression error. If everyone has the same problem, be sure to quote the tx
(async/<!! (pathom-parser {} '[{(mutation {:param "value"}) [:selection]}))
ah yeah, you typically fully-qualify the tx with the syntax-quote and then use ~
for param symbols substitution https://clojure.org/reference/reader
@koivistoinen.tuomas also, the bug around mutation responses is fixed on the Pathom Viz standalone app, if you wanna use that: https://clojurians.slack.com/archives/C06MAR553/p1587880194322000
@wilkerlucio The Index Explorer in the latest Fulcro Inspect Binary seems to have broken CSS
All classes in the style-tag have unknown_unknown__
as prefix.
.unknown_unknown__container {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
overflow: hidden;
}
.unknown_unknown__selector {
font-family: sans-serif;
user-select: none;
align-items: center;
padding: 12px;
border-top: 1px solid #ccc;
font-size: 12px;
display: flex;
background: #F3F3F3;
color: #5A5A5A;
}
```thats weird, @U0CKQ19AQ you have an idea what may caused this?