Hamburgert
Hamburgert
DTDrizzle Team
Created by Hamburgert on 1/18/2025 in #help
Reusable values for `with` property in findFirst and findMany
This works as expected: const result = await db.query.users.findFirst({ with: { usersMeta: true }}); I want to achieve something like this:
const defaultWith = { usersMeta: true };
const result = await db.query.users.findFirst({ with: defaultWith });
const defaultWith = { usersMeta: true };
const result = await db.query.users.findFirst({ with: defaultWith });
Typescript complains about the type at with: defaultWith. Is it possible to make the with-property value reusable across multiple query code snippets?
1 replies