1👍
To my best knowledge it is perfectly fine to make the queries directly at the appropriate places.
I do not see how your proposed abstraction adds any value. The exception would be if you modify the queried data somehow before returning it.
👤WeGi
0👍
If you are using the queries in multiple places, it’s probably a good idea. In the future if a query changes or needs permissions applied, you can just change the method. But I wouldn’t bother creating the methods until you are actually writing duplicate queries.
👤A—
Source:stackexchange.com