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 });

Typescript complains about the type at
with: defaultWith
. Is it possible to make the with-property value reusable across multiple query code snippets?
Was this page helpful?