This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-04
Channels
- # announcements (7)
- # aws (5)
- # babashka (72)
- # beginners (43)
- # calva (12)
- # cider (9)
- # clara (3)
- # clj-kondo (12)
- # cljdoc (32)
- # cljs-dev (10)
- # cljsrn (1)
- # clojure (78)
- # clojure-dev (50)
- # clojure-europe (17)
- # clojure-gamedev (8)
- # clojure-nl (1)
- # clojure-spec (30)
- # clojure-uk (3)
- # clojurescript (52)
- # core-async (1)
- # cursive (5)
- # datomic (8)
- # emacs (58)
- # events (2)
- # fulcro (5)
- # graalvm (7)
- # holy-lambda (37)
- # honeysql (9)
- # jobs (5)
- # leiningen (3)
- # lsp (7)
- # lumo (2)
- # malli (3)
- # meander (13)
- # membrane-term (64)
- # missionary (19)
- # music (3)
- # nextjournal (8)
- # off-topic (29)
- # pathom (16)
- # polylith (14)
- # portal (16)
- # re-frame (2)
- # reagent (5)
- # sci (14)
- # shadow-cljs (20)
- # spacemacs (6)
- # sql (1)
- # tools-deps (58)
- # vim (14)
Hello, how do you use clojure testing with resolvers if I want to use interactive testing like in Calva? I tried changing the resolver, evaluated again and it seems keeping the old version
you have to remember to also reload the file that builds up the env
, so you can rebuild your indexes with the new resolver configuration
I think the problem is that the resolvers are in def
, so I have to reload the namespace and the namespace that call that name space, I did it and it worked, thank you
we can use the #'my-resolver
trick when building the index right @U066U8JQJ?
that is not enough, the problem is that what matters for pathom is the indexes, which get created on the pci/register
call, this is why this needs to be re-evaluated when resolver changes to compute the new indexes
there are possible tricks around, like keeping the indexes in an atom and derrefing at run time (using plugins), this approach has an issue with removing things, another approach would be to keep the resolvers in some mutable atom, and on each call re-compute all of it (something you surely don't wanna do in prod, but is useful in dev time)
what we do is to create pathom-env as fn, and during testing/dev we create always a new one on each call. ex:
(defn query! [context tx]
(interface/query! (p.eql/boundary-interface (interface/pathom-env context)) txl))
similar for dev, we have an interceptor that creates the pathom boudnary-interface for each request
still the downside is that pathom-viz connector doesn’t see the changes, so when needed we connect to connector via http that triggers the reload interceptor.
I’m wondering what is the expected behavior of having nested and optional input in a resolver input at the same time (ex: ::pco/input (pco/? {:nested [:id :name]})
)? I’ve tried and I don’t get the result I would expect.
Here what I mean, I think it’s a bug actually https://gist.github.com/cyppan/bbdfdb16d267051ad1e675c4a38ced5f
that optional is misplaced, it should be [{(pco/? :nested) [:id :name]}]
oh yes I messed up my repro case sorry I’ve updated the gist, I still have the problem https://gist.github.com/cyppan/bbdfdb16d267051ad1e675c4a38ced5f
confirmed the report, tracking issue: https://github.com/wilkerlucio/pathom3/issues/107