Fork me on GitHub
#pathom
<
2022-03-30
>
markaddleman20:03:30

In my Pathom 3 app, I have a resolver that reads and interprets an edn data file. Within that data file are pathom queries that should be resolved under the context of the loading resolver as part of its interpret operation. So, I reuse the resolver's env when executing the data file's pathom queries. Are there any performance or functional implications of reusing the env this way? The only (very minor) side affect of this approach is that the Pathom Visualizer sees the data file queries as separate queries.

wilkerlucio20:03:20

its fine to use env in this way, one thing to keep in mind is that the env from inside a resolver will already contains some caches (both standard and internal ones) that you may want to elide when doing the next call, you can use the helper (pcp/reset-env env) to get a hold of a clean version (in terms of caches and processing things) of the env

wilkerlucio20:03:49

so the call may look like: (p.eql/process (pcp/reset-env env) [...])

👍 1