is it possible to do conditional relational queries?

same question here. the query works but typescript isnt happy

  const t = await db.query.campaigns.findMany({
    where: isNotNull(campaigns.userId),
    with: {
      user: {
        // @ts-ignore
        where: eq(users.clerkId, userId),
      },
    },
  });
Was this page helpful?