Vignesh GuptaV
Convex Community3y ago
2 replies
Vignesh Gupta

UseQuery Issue

Hey All,
I'm following the doc - https://docs.convex.dev/functions/query-functions#query-context


my convex function
export const getTask = query({
  args: { id: v.id("tasks") },
  handler: async (ctx, args) => {
    return await ctx.db.get(args.id);
  },
});


calling from frontend-
const task = useQueries(api.tasks.getTask, {id: "3a3xm5jy5992ta30kvwety479jd8hz0"});


But getting an error - Expected 1 arguments, but got 2.ts(2554)
Queries are the bread and butter of your backend API. They fetch data from the
Queries | Convex Developer Hub
Was this page helpful?