RobertR
Convex Community12mo ago
66 replies
Robert

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 }) => { ... }),
});

In the Fast5 repo, gameId has the proper type:
(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

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! 😊
Was this page helpful?