Fork me on GitHub
#pathom
<
2019-08-05
>
Andreas Edvardsson11:08:13

I’m trying to get a query to be read-consistent by providing a “db as a value” in the env, which works fine as long as I provide it myself. However, if no db value is provided, I have attempted to use a plugin to populate the environment with the value in question, which almost works. However, not fully understanding pathom yet, I suspect that this breaks with parallel resolving (or something like that) within a single query. Any tips on how to best implement this pattern? Thanks for providing a super cool library!

wilkerlucio13:08:54

@andreas179 hello, for your use case I think :wrap-read is not a good option, you can instead use a :wrap-parser to work around the whole processing, so you can set the db once and get that shared in env across the readers, very similar to what you did

Andreas Edvardsson13:08:48

Ah, alright! Sounds exactly like what I am after! I find the sheer amount of flexibility and extensibility Pathom provides just astonishing, even though the docs takes a while to digest :) Thanks @wilkerlucio !

🙏 4
wilkerlucio14:08:17

thanks for the feedback, I'm currently changing many things about the docs, I hope the new version can be easier to digest 😉