Why is calling Convex queries/mutations directly an anti-pattern?
The docs recommend relocating your functions into a
model/ directory, and then importing and calling those functions from your Convex mutations and queries.I have a few questions:
1. Why is calling Convex functions from other functions an anti-pattern, specifically?
2. The examples in the docs take the logic from the original query/mutation and relocate it to a new function in a directory called
model/, and then import and call that function from the original mutation/query. I don't fully understand the rationale behind this, since now there are two separate files with similar/identical function names, and two places to test instead of one.3. For maintainability, is the recommendation to relocate all query and mutation logic into a separate function within
model/? My first intuition was to only relocate the shared logic, but the docs seem to suggest otherwise?
