ZerodayZ
Convex Community11mo ago
2 replies
Zeroday

Convex type errors and modular folder structure

Hi, I just started using Convex and all of the documentation shows that the schema info should be in the schema.ts file. However, my files are starting to stack up and I would like to rather have things be modular having a schema folder with my schema files in it making it nice and clean to add more tables in separate files, however, when I did this I start to get lots of type issues. Such as: Argument of type '"profileId"' is not assignable to parameter of type 'never'.

code:

// Get links for this profile
const links = await ctx.db
.query("links")
.withIndex("by_profile_id", q => q.eq("profileId", profile._id))
.filter(q => q.eq(q.field("isDeleted"), false))
.collect();

I'm opening this support ticket to ask if moving my schema into separate files within the schema folder is something that is supported/recommended and why these type issues started after doing this.
Thanks!
Screenshot_2025-03-16_at_1.52.17_AM.png
Was this page helpful?