push code push code
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user