edE
Convex Community6mo ago
45 replies
ed

Convex code generation where it doesn't give types when I run a mutation / query

I'm running into an issue with my Convex code generation where it doesn't give types when I run a mutation / query. Below would be an example of a query that I would send, but this would always be the type definition.

import { v } from "convex/values";

import type { Doc } from "./_generated/dataModel";
import { internalMutation, internalQuery } from "./_generated/server";

export const getUserSummary = internalQuery({
args: { userId: v.id("users") },
handler: async (ctx, args): Promise<Doc<"userMemorySummaries"> | null> => {
return ctx.db
.query("userMemorySummaries")
.withIndex("by_user", (q) => q.eq("userId", args.userId))
.first();
},
});
Was this page helpful?