Why I am getting typescript type error in my findOne function
Getting error in two places, in
keyof S and in findOne function, but if I am doing same thing in other project its working fine but not in Prisma, am I doing wrong?export interface RoleService {
findOne: <S extends NonNullable<RoleFindFirstArgs['select']>>(
params: RequireAtLeastOne<Omit<NonNullable<RoleFindFirstArgs['where']>, 'type'>>,
select: S,
) => Promise<Pick<RoleSchema, keyof S> | null>;
}
const findOne: RoleService['findOne'] = async (params, select) => {
const data = await prismaClient.role.findFirst({
where: {
...params,
type: {
in: userTypesOfNoDefaults,
},
},
select,
});
return data;
};keyof SfindOne