Fix graphql queries
This commit is contained in:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user