Relevant Schema:
users: defineTable({
name: v.optional(v.string()),
image: v.optional(v.string()),
email: v.optional(v.string()),
emailVerificationTime: v.optional(v.number()),
phone: v.optional(v.string()),
phoneVerificationTime: v.optional(v.number()),
isAnonymous: v.optional(v.boolean()),
}).index("email", ["email"]),
boards: defineTable({
title: v.string(),
}),
userBoards: defineTable({
userId: v.id("users"),
boardId: v.id("boards"),
})
.index("userId", ["userId"])
.index("boardId", ["boardId"]),
Mutation:
export const getUserBoards = query({
args: {},
handler: async (ctx) => {
const userId = await getAuthUserId(ctx);
if (!userId) {
throw new Error("Not authenticated");
}
const boards = await getManyViaOrThrow(ctx.db, "userBoards", "boardId", "userId", userId);
return boards;
},
});
Error:
Expected 6 arguments, but got 5.ts(2554)
relationships.d.ts(157, 618): Arguments for the rest parameter 'fieldArg' were not provided.
I have thoroughly read the "Database Relationships Helpers" article:
https://stack.convex.dev/functional-relationships-helpers
But I can't find an example where he uses 6 arguments, nor can I find any examples or documentation that lists the 6 required arguments.