cyremurC
Convex Community3y ago
14 replies
cyremur

Types of function context and arguments

let's say I want to create a utility function that does a query inside a function like this:
async function loadGame(db, id) {
  const game = (await db
    .query("games")
    .filter((q) => q.eq(q.field("_id"), id))
    .unique()) ?? raise(`Game with id ${id} doesn't exist.`);
  return game ;
}

what's the correct typing on db and id?
Was this page helpful?