Fix graphql queries

This commit is contained in:
Charles Bochet
2023-05-26 00:31:43 +02:00
parent b0044ed1a2
commit 17f5cf1766
1012 changed files with 301 additions and 19768 deletions

View File

@ -4,22 +4,34 @@ import { PrismaService } from 'src/database/prisma.service';
@Injectable()
export class WorkspaceRepository {
constructor(private prisma: PrismaService) {}
constructor(private prisma: PrismaService) {}
async findMany(params: {
skip?: number;
take?: number;
cursor?: Prisma.WorkspaceWhereUniqueInput;
where?: Prisma.WorkspaceWhereInput;
orderBy?: Prisma.WorkspaceOrderByWithRelationInput;
}): Promise<Workspace[]> {
const { skip, take, cursor, where, orderBy } = params;
return this.prisma.workspace.findMany({ skip, take, cursor, where, orderBy });
}
async findMany(params: {
skip?: number;
take?: number;
cursor?: Prisma.WorkspaceWhereUniqueInput;
where?: Prisma.WorkspaceWhereInput;
orderBy?: Prisma.WorkspaceOrderByWithRelationInput;
}): Promise<Workspace[]> {
const { skip, take, cursor, where, orderBy } = params;
return this.prisma.workspace.findMany({
skip,
take,
cursor,
where,
orderBy,
});
}
async findUnique(
data: Prisma.WorkspaceFindUniqueArgs,
): Promise<Workspace | null> {
return await this.prisma.workspace.findUnique(data);
}
async findUnique(
params: Prisma.WorkspaceFindUniqueArgs,
): Promise<Workspace | null> {
return await this.prisma.workspace.findUnique(params);
}
async findFirst(
params: Prisma.WorkspaceFindFirstArgs,
): Promise<Workspace | null> {
return await this.prisma.workspace.findFirst(params);
}
}