Fork me on GitHub

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))

👍 2

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.


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

👀 1