export const authedQuery = customQuery(query, {
args: {},
input: async (ctx) => {
return { ctx: { user }, args: {} };
},
});
export const insideOrganizationQuery = customQuery(authedQuery, {
args: { organizationId: v.id("organizations") },
input: async (ctx, { organizationId }) => {
ctx.user; // TS Error: Property 'user' does not exist
return { ctx: { }, args: {} };
},
});
export const get = insideOrganizationQuery({
handler(ctx) {
ctx.organization; // Works
ctx.user; // // TS Error: Property 'user' does not exist
},
})
export const authedQuery = customQuery(query, {
args: {},
input: async (ctx) => {
return { ctx: { user }, args: {} };
},
});
export const insideOrganizationQuery = customQuery(authedQuery, {
args: { organizationId: v.id("organizations") },
input: async (ctx, { organizationId }) => {
ctx.user; // TS Error: Property 'user' does not exist
return { ctx: { }, args: {} };
},
});
export const get = insideOrganizationQuery({
handler(ctx) {
ctx.organization; // Works
ctx.user; // // TS Error: Property 'user' does not exist
},
})