Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Simplify CategoryDelete mutation
Adam Janik13af4326256b
diff --git a/saleor/dashboard/graphql/product/mutations.py b/saleor/dashboard/graphql/product/mutations.pyindex 5042bd41b3..dcc2f21e34 100644--- a/saleor/dashboard/graphql/product/mutations.py+++ b/saleor/dashboard/graphql/product/mutations.py@@ -4,8 +4,8 @@ from ....graphql.product.types import Categoryfrom ....graphql.utils import get_nodefrom ...category.forms import CategoryFormfrom ..mutations import (- BaseMutation, ModelFormMutation, ModelFormUpdateMutation)-+ ModelDeleteMutation, ModelFormMutation, ModelFormUpdateMutation)+from ....product import modelsclass CategoryCreateMutation(ModelFormMutation):class Arguments:@@ -37,13 +37,7 @@ class CategoryUpdateMutation(ModelFormUpdateMutation):return kwargs-class CategoryDelete(BaseMutation):- category = graphene.Field(Category)-- class Arguments:- id = graphene.ID()+class CategoryDelete(ModelDeleteMutation):- def mutate(self, info, id):- category = get_node(info, id, only_type=Category)- category.delete()- return CategoryDelete(category=category)+ class Meta:+ model = models.Category