Rene Nielsen
10/20/2021, 7:13 AMlet filter = {
include: {
category: true,
instructor: true,
lections: true,
},
where: {
OR: [
{
title: {
startsWith: search,
mode: 'insensitive',
},
},
{
title: {
contains: search,
mode: 'insensitive',
},
},
{
description: {
startsWith: search,
mode: 'insensitive',
},
},
{
description: {
contains: search,
mode: 'insensitive',
},
},
]
}
};
I get the following Typescript error. (Using Prisma 3.3.0)
Argument of type '{ include: { category: boolean; instructor: boolean; lections: boolean; }; where: { OR: ({ title: { startsWith: any; mode: string; contains?: undefined; }; description?: undefined; } | { title: { contains: any; mode: string; startsWith?: undefined; }; description?: undefined; } | { ...; } | { ...; })[]; }; }' is not assignable to parameter of type '{ select?: CourseSelect | null | undefined; include?: CourseInclude | null | undefined; where?: CourseWhereInput | undefined; orderBy?: Enumerable<...> | undefined; cursor?: CourseWhereUniqueInput | undefined; take?: number | undefined; skip?: number | undefined; distinct?: Enumerable<...> | undefined; }'.
The types of 'where.OR' are incompatible between these types.
Type '({ title: { startsWith: any; mode: string; contains?: undefined; }; description?: undefined; } | { title: { contains: any; mode: string; startsWith?: undefined; }; description?: undefined; } | { description: { ...; }; title?: undefined; } | { ...; })[]' is not assignable to type 'Enumerable<CourseWhereInput> | undefined'.
Type '({ title: { startsWith: any; mode: string; contains?: undefined; }; description?: undefined; } | { title: { contains: any; mode: string; startsWith?: undefined; }; description?: undefined; } | { description: { ...; }; title?: undefined; } | { ...; })[]' is not assignable to type 'CourseWhereInput[]'.
Type '{ title: { startsWith: any; mode: string; contains?: undefined; }; description?: undefined; } | { title: { contains: any; mode: string; startsWith?: undefined; }; description?: undefined; } | { description: { ...; }; title?: undefined; } | { ...; }' is not assignable to type 'CourseWhereInput'.
Type '{ title: { startsWith: any; mode: string; contains?: undefined; }; description?: undefined; }' is not assignable to type 'CourseWhereInput'.
Types of property 'title' are incompatible.
Type '{ startsWith: any; mode: string; contains?: undefined; }' is not assignable to type 'string | StringFilter | undefined'.
Type '{ startsWith: any; mode: string; contains?: undefined; }' is not assignable to type 'StringFilter'.
Types of property 'mode' are incompatible.
Type 'string' is not assignable to type 'QueryMode | undefined'.ts(2345)
Ryan
10/20/2021, 10:52 AMsearch
here is not undefined?Ryan
10/20/2021, 10:52 AMRene Nielsen
10/20/2021, 12:21 PMRene Nielsen
10/20/2021, 12:21 PMRene Nielsen
10/20/2021, 12:25 PMRene Nielsen
10/20/2021, 12:27 PMTypes of property 'mode' are incompatible. Type 'string' is not assignable to type 'QueryMode | undefined'.ts(2345)`
Ryan
10/20/2021, 12:40 PMRene Nielsen
10/20/2021, 1:47 PMRyan
10/20/2021, 1:55 PMRene Nielsen
10/21/2021, 10:24 AMlet filter: Prisma.CourseFindManyArgs = {}