api.somemodule.somefunction
I have several mature modules (ie, api.user., api.blogs., etc) and i try to break them up into smaller files but it breaks everything unless i rename everything.
Shouldn't convex also support the index.ts principal?
I can update all the projects to call api functions differently, but it is kind of a pain in the butt when and index should do.
or is there a way to do this i am missing in the documenation?
5 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!

Yeah I'd personally love it for us to support
index.ts
for resolution. A couple issues currently:
- if you have convex/users.ts
and convex/users/index.ts
- being able to generate a unique identifier for the function, without knowing your file structure from the client (e.g. is it users/index:getPresence
or users:getPresence
? )
As a workaround, if you have users.ts
and users/queries.ts
does it work?nope. it strictly follows file name (path) if in my users folder i have index and say mutation, queries...i can use either
api.users.queries.*
or api.users.index.*
I don't think you understood my suggestion, and I just validated that it works. Here's what it looks like:
You can then do
api.users.getPresence
and api.users.mutations.foo
Basically swap foo/index.ts
into foo.ts
This is one of the ambiguities that comes with supporting index.ts
- knowing where to route things when you have folders & files with the same name