where filter returning typescript error when nested within a with
const disputedMatches = await db.query.active_members.findMany({
where: (active_members, { eq }) => eq(active_members.user_id, id),
with: {
match: {
where: (matches, { eq }) => eq(matches.status, 'DISPUTED'),
with: {
creatorTeam: true,
acceptorTeam: true,
game: true
}
}
}
}); const disputedMatches = await db.query.active_members.findMany({
where: (active_members, { eq }) => eq(active_members.user_id, id),
with: {
match: {
where: (matches, { eq }) => eq(matches.status, 'DISPUTED'),
with: {
creatorTeam: true,
acceptorTeam: true,
game: true
}
}
}
});the where inside the with is giving a type error of
Object literal may only specify known properties, and 'where' does not exist in type '{ columns?: { id?: boolean; teamA_reported_status?: boolean; teamB_reported_status?: boolean; start_time?: boolean; expire_time?: boolean; team_size?: boolean; team_type?: boolean; admin_requested?: boolean; ... 14 more ...; teamB_id?: boolean; }; with?: { ...; }; extras?: Record<...> | ((fields: { ...; }, operators...'.ts(2353)Object literal may only specify known properties, and 'where' does not exist in type '{ columns?: { id?: boolean; teamA_reported_status?: boolean; teamB_reported_status?: boolean; start_time?: boolean; expire_time?: boolean; team_size?: boolean; team_type?: boolean; admin_requested?: boolean; ... 14 more ...; teamB_id?: boolean; }; with?: { ...; }; extras?: Record<...> | ((fields: { ...; }, operators...'.ts(2353)any guidance would be amazing
