Using Effect services to provide reader OR writer database contexts
I'm working with Confect and I like to break down functions into mini-effects than can be reused across various mutations and queries. The difficulty is that we access the database wrapper via either
ConfectQueryCtx
ConfectQueryCtx
or
ConfectMutationCtx
ConfectMutationCtx
depending on if it's a query or a mutation.
I've prepared an example in the replies to show how they're different. It's too long for the post but it's important context I'm only interested in the reader functions for this:
[see replies]
So my question put simply is: Is there any way to model this such that I can leverage the services and providers to provide EITHER