Robert
Robert
CCConvex Community
Created by Robert on 2/7/2025 in #support-community
Type Issue with gameId in Convex Query
Hi, I have an issue with TypeScript types in Convex. I'm looking at the example code in the Fast5 repo:
import { v } from "convex/values";
import { query } from "../_generated/server";
import { withUser } from "../wrappers/withUser";

export default query({
args: {
gameId: v.id("games"),
},
handler: withUser(async ({ db, user }, { gameId }) => { ... }),
});
import { v } from "convex/values";
import { query } from "../_generated/server";
import { withUser } from "../wrappers/withUser";

export default query({
args: {
gameId: v.id("games"),
},
handler: withUser(async ({ db, user }, { gameId }) => { ... }),
});
In the Fast5 repo, gameId has the proper type:
(parameter) gameId: Id<"games">
(parameter) gameId: Id<"games">
However, when I use the exact same code in my repo, the type of gameId is inferred as:
(parameter) gameId: any
(parameter) gameId: any
I’m wondering why this is happening. Could this be related to TypeScript configuration, Convex version differences, or something else? Any help would be appreciated! Thanks! 😊
67 replies