Nested convex folders & Type inference
This works well in general, allowing something like
api.users.getUser to become api.users.queries.getUser. BUT, there is a huge drawback to this approach: Typescript inference becomes entirely generic for me when folders are nested, meaning I lose all type safety in my frontend queries.For instance, I have a file
convex/auth.ts and also convex/users/functions.ts. These both work in my frontend, but when introspecting the type of the api object, we get very different results (see screenshot 1)Similarly the result of a function call from the
auth.ts file is type-safe (screenshot 2)While the result of a function call from the
users/functions.ts file is always any (screenshot 3)Is this just a limitation of the type inferences that are set up, or is there something more I can do to better enable type inference here?



