diff --git a/src/center/center.schema.ts b/src/center/center.schema.ts index e903fe7..55f8098 100644 --- a/src/center/center.schema.ts +++ b/src/center/center.schema.ts @@ -83,6 +83,41 @@ export class CenterSchema extends PothosSchema { }); }, }), + updateCenter: t.prismaField({ + type: this.center(), + args: { + input: t.arg({ + type: this.builder.generator.getUpdateInput('Center'), + required: true, + }), + where: t.arg({ + type: this.builder.generator.getWhereUnique('Center'), + required: true, + }), + }, + resolve: async (query, root, args, ctx, info) => { + return await this.prisma.center.update({ + ...query, + where: args.where, + data: args.input, + }); + }, + }), + deleteCenter: t.prismaField({ + type: this.center(), + args: { + where: t.arg({ + type: this.builder.generator.getWhereUnique('Center'), + required: true, + }), + }, + resolve: async (query, root, args, ctx, info) => { + return await this.prisma.center.delete({ + ...query, + where: args.where, + }); + }, + }), })); } }