Vignesh Gupta
Vignesh Gupta17mo ago

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);
},
});
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"});
const task = useQueries(api.tasks.getTask, {id: "3a3xm5jy5992ta30kvwety479jd8hz0"});
But getting an error - Expected 1 arguments, but got 2.ts(2554)
Queries | Convex Developer Hub
Queries are the bread and butter of your backend API. They fetch data from the
2 Replies
jamwt
jamwt17mo ago
@Vignesh Gupta maybe you want useQuery not useQueries
Vignesh Gupta
Vignesh GuptaOP17mo ago
Oh! thanks!

Did you find this page helpful?