Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove null error code
Aleksander Spyra04a89f572c54
diff --git a/saleor/graphql/core/utils/error_codes.py b/saleor/graphql/core/utils/error_codes.pyindex caa5b71220..31d5e7f5b0 100644--- a/saleor/graphql/core/utils/error_codes.py+++ b/saleor/graphql/core/utils/error_codes.py@@ -44,7 +44,6 @@ class AccountErrorCode(Enum):INVALID_PHONE_NUMBER = "invalid_phone_number"INVALID_STOREFRONT_URL = "invalid_storefront_url"INVALID_TOKEN = "invalid_token"- NULL = "null"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"PASSWORD_ENTIRELY_NUMERIC = "password_entirely_numeric"PASSWORD_TOO_COMMON = "password_too_common"@@ -63,7 +62,6 @@ class CheckoutErrorCode(Enum):INVALID_COUNTRY = "invalid_country"INVALID_PHONE_NUMBER = "invalid_phone_number"INVALID_SHIPPING_METHOD = "invalid_shipping_method"- NULL = "null"OBJECT_ALREADY_EXISTS = "object_already_exists"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"PAYMENT_ERROR = "payment_error"@@ -85,7 +83,6 @@ class MenuErrorCode(Enum):INVALID = "invalid"INVALID_MENU_ITEM = "invalid_menu_item"NO_MENU_ITEM_PROVIDED = "no_item_provided"- NULL = "null"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"REQUIRED = "required"TOO_MANY_MENU_ITEMS = "too_many_items"@@ -102,7 +99,6 @@ class OrderErrorCode(Enum):FULFILL_ORDER_LINE = "fulfill_order_line"GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"- NULL = "null"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"ORDER_INVALID_SHIPPING_METHOD = "order_invalid_shipping_method"ORDER_NO_SHIPPING_ADDRESS = "order_no_shipping_address"@@ -123,7 +119,6 @@ class ProductErrorCode(Enum):GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"NOT_PRODUCTS_IMAGE = "not_products_image"- NULL = "null"OBJECT_ALREADY_EXISTS = "object_already_exists"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"REQUIRED = "required"@@ -135,7 +130,6 @@ class ShopErrorCode(Enum):CANNOT_FETCH_TAX_RATES = "cannot_fetch_tax_rates"GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"- NULL = "null"OBJECT_ALREADY_EXISTS = "object_already_exists"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"REQUIRED = "required"@@ -146,7 +140,6 @@ class ShippingErrorCode(Enum):GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"MAX_LESS_THAN_MIN = "max_less_than_min"- NULL = "null"OBJECT_ALREADY_EXISTS = "object_already_exists"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"REQUIRED = "required"@@ -157,7 +150,6 @@ class PaymentErrorCode(Enum):BILLING_ADDRESS_NOT_SET = "billing_address_not_set"GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"- NULL = "null"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"PARTIAL_PAYMENT_NOT_ALLOWED = "partial_payment_not_allowed"PAYMENT_ERROR = "payment_error"@@ -168,7 +160,6 @@ class PaymentErrorCode(Enum):class GiftcardErrorCode(Enum):GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"- NULL = "null"OBJECT_ALREADY_EXISTS = "object_already_exists"OBJECT_DOES_NOT_EXIST = "object_does_not_exist"REQUIRED = "required"@@ -178,7 +169,6 @@ class GiftcardErrorCode(Enum):class ExtensionsErrorCode(Enum):GRAPHQL_ERROR = "graphql_error"INVALID = "invalid"- NULL = "null"PLUGIN_MISCONFIGURED = "plugin-misconfigured"REQUIRED = "required"UNIQUE = "unique"@@ -214,5 +204,5 @@ def get_error_code_from_error(error):if isinstance(code, Enum):code = code.valueif code not in saleor_error_codes:- return "null"+ return "invalid"return codediff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 758d81189f..1d9128364c 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -52,7 +52,6 @@ enum AccountErrorCode {INVALID_PHONE_NUMBERINVALID_STOREFRONT_URLINVALID_TOKEN- NULLOBJECT_DOES_NOT_EXISTPASSWORD_ENTIRELY_NUMERICPASSWORD_TOO_COMMON@@ -697,7 +696,6 @@ enum CheckoutErrorCode {INVALID_COUNTRYINVALID_PHONE_NUMBERINVALID_SHIPPING_METHOD- NULLOBJECT_ALREADY_EXISTSOBJECT_DOES_NOT_EXISTPAYMENT_ERROR@@ -1542,7 +1540,6 @@ type ExtensionsError {enum ExtensionsErrorCode {GRAPHQL_ERRORINVALID- NULLPLUGIN_MISCONFIGUREDREQUIREDUNIQUE@@ -1696,7 +1693,6 @@ type GiftcardError {enum GiftcardErrorCode {GRAPHQL_ERRORINVALID- NULLOBJECT_ALREADY_EXISTSOBJECT_DOES_NOT_EXISTREQUIRED@@ -1839,7 +1835,6 @@ enum MenuErrorCode {INVALIDINVALID_MENU_ITEMNO_MENU_ITEM_PROVIDED- NULLOBJECT_DOES_NOT_EXISTREQUIREDTOO_MANY_MENU_ITEMS@@ -2352,7 +2347,6 @@ enum OrderErrorCode {FULFILL_ORDER_LINEGRAPHQL_ERRORINVALID- NULLOBJECT_DOES_NOT_EXISTORDER_INVALID_SHIPPING_METHODORDER_NO_SHIPPING_ADDRESS@@ -2687,7 +2681,6 @@ enum PaymentErrorCode {BILLING_ADDRESS_NOT_SETGRAPHQL_ERRORINVALID- NULLOBJECT_DOES_NOT_EXISTPARTIAL_PAYMENT_NOT_ALLOWEDPAYMENT_ERROR@@ -2904,7 +2897,6 @@ enum ProductErrorCode {GRAPHQL_ERRORINVALIDNOT_PRODUCTS_IMAGE- NULLOBJECT_ALREADY_EXISTSOBJECT_DOES_NOT_EXISTREQUIRED@@ -3536,7 +3528,6 @@ enum ShippingErrorCode {GRAPHQL_ERRORINVALIDMAX_LESS_THAN_MIN- NULLOBJECT_ALREADY_EXISTSOBJECT_DOES_NOT_EXISTREQUIRED@@ -3707,7 +3698,6 @@ enum ShopErrorCode {CANNOT_FETCH_TAX_RATESGRAPHQL_ERRORINVALID- NULLOBJECT_ALREADY_EXISTSOBJECT_DOES_NOT_EXISTREQUIRED