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