fix order mutation
This commit is contained in:
@@ -65,6 +65,9 @@ export class OrderSchema extends PothosSchema {
|
||||
});
|
||||
},
|
||||
}),
|
||||
}));
|
||||
// mutation section
|
||||
this.builder.mutationFields((t) => ({
|
||||
createOrder: t.prismaField({
|
||||
type: this.order(),
|
||||
args: {
|
||||
@@ -80,6 +83,21 @@ export class OrderSchema extends PothosSchema {
|
||||
});
|
||||
},
|
||||
}),
|
||||
deleteOrder: t.prismaField({
|
||||
type: this.order(),
|
||||
args: {
|
||||
where: t.arg({
|
||||
type: this.builder.generator.getWhereUnique('Order'),
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
resolve: async (query, root, args, ctx, info) => {
|
||||
return await this.prisma.order.delete({
|
||||
...query,
|
||||
where: args.where,
|
||||
});
|
||||
},
|
||||
}),
|
||||
updateOrder: t.prismaField({
|
||||
type: this.order(),
|
||||
args: {
|
||||
|
||||
Reference in New Issue
Block a user