Conditional findFirst
Is it possible to conditionally use findFirst, rather than having to chain the underlying model.
E.g.
Into either:
E.g.
Into either:
const result = await db.query.users.findMany({
with: {
posts: true
},
});const result = await db.query(users).findMany({
with: {
posts: true
},
});
OR
const result = await db.query[modelName]findMany({
with: {
posts: true
},
});