Fork me on GitHub
#pathom
<
2022-07-26
>
Quentin Le Guennec07:07:45

Are recursive calls to p.eql/process supposed to work?

Quentin Le Guennec13:07:37

Ok. Should I purge the env with the current plan if I do so?

souenzzo13:07:29

Oh, I see. I had this cache/context issue in pathom2. By doing this, we can discover dynamically which keys pathom3 create in the process

(def keys-to-dissoc 
  (let [env (pci/register 
              [(pco/resolver `a
                 {::pco/output [:a]}
                 (fn [env _]
                   {:a (set  (keys env))}))
               (pco/mutation `b 
                 {}
                 (fn [_ _]))])
        init-ks (set (keys env))]
    (remove init-ks (:a (p.eql/process env [:a])))))
Then you can call (p.eql/process (apply dissoc env keys-to-dissoc) ...) Not an elegant solution. In theory, I think that nested process calls should be able to share indexes/caches/plans. What is the actual problem that you are having?

Quentin Le Guennec13:07:41

Well when I call process in a resolver, the output I get is different (empty) from when I get when I call that same query outside the resolver. It works when I pass the env before that resolver call.