ianpaschalI
Convex Communityβ€’11mo agoβ€’
5 replies
ianpaschal

How to re-organize api structure?

It's neat that Convex automatically structures the api object according to your folders, files, and function names, but on a larger project it becomes a bit impractical. For example, I have convex/users/fetchCurrentUser.ts with a function in there called, of course, fetchCurrentUser(). However, in order to consume this, I have to use:

const user = useQuery(api.users.fetchCurrentUser.fetchCurrentUser);


Is it possible to avoid this besides putting all functions in one file? That seems really impractical.
Was this page helpful?