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