Chris Tsongas
12/29/2021, 5:07 AMfindMany()
which is a bummer because if I just return that to Apollo it throws an error like "message": "Cannot return null for non-nullable field Query.employeeNotes."
. Is this a known issue that will get fixed? In the meantime as a workaround I have to await the result of the query and use the nullish coalescing operator to return an empty array if there are no results:
async getEmployeeNotes(employeeId: string): Promise<EmployeeNote[]> {
return (
(await prisma.employee
.findUnique({
where: {
id: employeeId,
},
})
.employeeNotes()) ?? []
)
},