Open
Description
Having problem right now to make TS happy. Is this currently proper usage useSuspenseQuery
? More info about my below:
const { data } = useSuspenseQuery(
// INFO: This is a workaround to get the data from the query (https://github.com/get-convex/convex-react-query/issues/8)
// @ts-expect-error
convexQuery(api.transactions.getByType, { type: "income" }),
);
export const getByType = query({
args: {
type: v.union(v.literal("income"), v.literal("expense")),
},
handler: async (ctx, args) => {
const user = await getCurrentUserOrThrow(ctx);
return await ctx.db
.query("transactions")
.withIndex("by_userId", (q) => q.eq("userId", user._id))
.filter((q) => q.eq(q.field("type"), args.type))
.collect();
},
});
Thing is wo @ts-expect-error
I'm not able to use this.
Metadata
Metadata
Assignees
Labels
No labels