push code push code

This commit is contained in:
2024-10-17 15:02:25 +07:00
parent 053fb38273
commit 59923b02cb
18 changed files with 106 additions and 0 deletions

View File

@@ -20,6 +20,7 @@ export class ScheduleSchema extends PothosSchema {
@PothosRef()
schedule() {
return this.builder.prismaObject('Schedule', {
description: 'A schedule in the system.',
fields: (t) => ({
id: t.exposeID('id'),
serviceId: t.exposeID('serviceId'),
@@ -35,6 +36,7 @@ export class ScheduleSchema extends PothosSchema {
this.builder.queryFields((t) => ({
schedule: t.prismaField({
type: this.schedule(),
description: 'Retrieve a single schedule by its unique identifier.',
args: this.builder.generator.findUniqueArgs('Schedule'),
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.schedule.findUnique({
@@ -47,6 +49,8 @@ export class ScheduleSchema extends PothosSchema {
schedules: t.prismaField({
type: [this.schedule()],
args: this.builder.generator.findManyArgs('Schedule'),
description:
'Retrieve a list of schedules with optional filtering, ordering, and pagination.',
resolve: async (query, root, args, ctx, info) => {
return await this.prisma.schedule.findMany({
...query,