Post

Maybe. Have a composable query module that web layer can access - chances are you will need parts of those queries elsewhere too. Context module should handle the actual fetch though so you have a spot to put weird stuff like loading virtual fields.

I remember hearing you talk about this approach in the past and liking the idea. I’ve struggled to find the right level of abstraction tho. Often it feels like an unnecessary layer over ecto. I can think of common filters that could work well as helpers tho. Maybe the mistake is early abstraction

The context is where the "fetch/list" happens and yeah could end up being a bit too convoluted when starting, but I think its the right place to consolidate when needed. The query module however doesn't actually _do_ anything but help compose the query with domain words-- the liveview would fetch.

No replies yet.