Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add errors info to mutations
Mira Szewczyke1c679c842e7
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex e6b9551f01..404d7df9bb 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -2079,7 +2079,7 @@ type Mutation {webhookDelete(id: ID!): WebhookDeletewebhookUpdate(id: ID!, input: WebhookUpdateInput!): WebhookUpdatecreateWarehouse(input: WarehouseCreateInput!): WarehouseCreate- updateWarehouse(id: ID!, input: WarehouseUpdateInput): WarehouseUpdate+ updateWarehouse(id: ID!, input: WarehouseUpdateInput!): WarehouseUpdatedeleteWarehouse(id: ID!): WarehouseDeleteauthorizationKeyAdd(input: AuthorizationKeyInput!, keyType: AuthorizationKeyType!): AuthorizationKeyAddauthorizationKeyDelete(keyType: AuthorizationKeyType!): AuthorizationKeyDelete@@ -4561,6 +4561,7 @@ type WarehouseCountableEdge {type WarehouseCreate {errors: [Error!]+ warehouseErrors: [WarehouseError!]warehouse: Warehouse}@@ -4586,6 +4587,7 @@ type WarehouseError {type WarehouseUpdate {errors: [Error!]+ warehouseErrors: [WarehouseError!]warehouse: Warehouse}diff --git a/saleor/graphql/warehouse/mutations.py b/saleor/graphql/warehouse/mutations.pyindex 49b6664fb1..9d537beed9 100644--- a/saleor/graphql/warehouse/mutations.py+++ b/saleor/graphql/warehouse/mutations.py@@ -28,6 +28,8 @@ class WarehouseCreate(ModelMutation):description = "Creates new warehouse."model = models.Warehousepermissions = ("warehouse.manage_warehouses",)+ error_type_class = WarehouseError+ error_type_field = "warehouse_errors"@classmethoddef create_address(cls, clean_data):@@ -47,10 +49,12 @@ class WarehouseUpdate(ModelMutation):model = models.Warehousepermissions = ("warehouse.manage_warehouses",)description = "Update given warehouse."+ error_type_class = WarehouseError+ error_type_field = "warehouse_errors"class Arguments:id = graphene.ID(description="ID of a warehouse to update.", required=True)- input = WarehouseUpdateInput()+ input = WarehouseUpdateInput(required=True)@classmethoddef update_address(cls, instance, cleaned_data):