🔥🔥🔥🔥🔥🔥

This commit is contained in:
2024-10-12 17:11:09 +07:00
parent ba77bd4e1c
commit 4fac0a052b
13 changed files with 354 additions and 4 deletions

View File

@@ -28,4 +28,23 @@ export class ServiceAndCategorySchema extends PothosSchema {
}),
});
}
@Pothos()
init(): void {
this.builder.queryFields((t) => ({
serviceAndCategories: t.prismaField({
type: [this.serviceAndCategory()],
args: this.builder.generator.findManyArgs('ServiceAndCategory'),
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.serviceAndCategory.findMany({
...query,
skip: args.skip ?? 0,
take: args.take ?? 10,
orderBy: args.orderBy ?? undefined,
where: args.filter ?? undefined,
});
},
}),
}));
}
}