Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add removal date to deprecated fields
fowczarek372f040f2dc4
diff --git a/saleor/graphql/account/mutations/deprecated_account.py b/saleor/graphql/account/mutations/deprecated_account.pyindex 96b9998299..b35c63f258 100644--- a/saleor/graphql/account/mutations/deprecated_account.py+++ b/saleor/graphql/account/mutations/deprecated_account.py@@ -24,7 +24,10 @@ class CustomerRegister(ModelMutation):)class Meta:- description = "DEPRECATED: Use AccountRegister instead. Register a new user."+ description = (+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "use AccountRegister instead. Register a new user."+ )exclude = ["password"]model = models.User@@ -44,7 +47,7 @@ class LoggedUserUpdate(BaseCustomerCreate):class Meta:description = (- "DEPRECATED: Use AccountUpdate instead. "+ "DEPRECATED: Will be removed in Saleor 2.10, use AccountUpdate instead.""Updates data of the logged in user.")exclude = ["password"]@@ -81,8 +84,8 @@ class CustomerAddressCreate(ModelMutation):class Meta:description = (- "DEPRECATED: Use AccountAddressCreate instead."- "Create a new address for the customer."+ "DEPRECATED: Will be removed in Saleor 2.10, use AccountAddressCreate "+ "instead. Create a new address for the customer.")model = models.Addressexclude = ["user_addresses"]@@ -120,8 +123,8 @@ class CustomerSetDefaultAddress(BaseMutation):class Meta:description = (- "DEPRECATED: Use AccountSetDefaultAddress instead."- "Sets a default address for the authenticated user."+ "DEPRECATED: Will be removed in Saleor 2.10, use AccountSetDefaultAddress "+ "instead. Sets a default address for the authenticated user.")@classmethod@@ -160,8 +163,8 @@ class CustomerPasswordReset(BaseMutation):class Meta:description = (- "DEPRECATED: Use RequestPasswordReset instead."- "Resets the customer's password."+ "DEPRECATED: Will be removed in Saleor 2.10, use RequestPasswordReset "+ "instead. Resets the customer's password.")@classmethoddiff --git a/saleor/graphql/account/mutations/deprecated_staff.py b/saleor/graphql/account/mutations/deprecated_staff.pyindex 6083c8c5b8..9095635647 100644--- a/saleor/graphql/account/mutations/deprecated_staff.py+++ b/saleor/graphql/account/mutations/deprecated_staff.py@@ -27,8 +27,8 @@ class PasswordReset(BaseMutation):class Meta:description = (- "DEPRECATED: Use RequestPasswordReset instead."- "Sends an email with the account password change link to customer."+ "DEPRECATED: Will be removed in Saleor 2.10, use RequestPasswordReset "+ "instead. Sends an email with the account password change link to customer.")permissions = ("account.manage_users",)diff --git a/saleor/graphql/checkout/mutations.py b/saleor/graphql/checkout/mutations.pyindex e200e60331..08f108c955 100644--- a/saleor/graphql/checkout/mutations.py+++ b/saleor/graphql/checkout/mutations.py@@ -643,9 +643,9 @@ class CheckoutUpdateVoucher(BaseMutation):class Meta:description = (- "DEPRECATED: Use CheckoutAddPromoCode or CheckoutRemovePromoCode instead. "- "Adds voucher to the checkout. Query it without voucher_code "- "field to remove voucher from checkout."+ "DEPRECATED: Will be removed in Saleor 2.10, use CheckoutAddPromoCode "+ "or CheckoutRemovePromoCode instead. Adds voucher to the checkout. Query "+ "it without voucher_code field to remove voucher from checkout.")@classmethoddiff --git a/saleor/graphql/checkout/types.py b/saleor/graphql/checkout/types.pyindex 61713fab0b..ac656ac7f6 100644--- a/saleor/graphql/checkout/types.py+++ b/saleor/graphql/checkout/types.py@@ -88,7 +88,12 @@ class Checkout(MetadataObjectType, CountableDjangoObjectType):"shipping costs, and discounts included."),)- discount_amount = graphene.Field(Money, deprecation_reason="Use discount instead.")+ discount_amount = graphene.Field(+ Money,+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, use discount instead."+ ),+ )class Meta:only_fields = [diff --git a/saleor/graphql/discount/mutations.py b/saleor/graphql/discount/mutations.pyindex e432cb19ec..211552477d 100644--- a/saleor/graphql/discount/mutations.py+++ b/saleor/graphql/discount/mutations.py@@ -82,13 +82,7 @@ class BaseDiscountCatalogueMutation(BaseMutation):class VoucherInput(graphene.InputObjectType):type = VoucherTypeEnum(- description=(- "Voucher type: PRODUCT, CATEGORY SHIPPING or ENTIRE_ORDER.\n"- "Deprecated fields:\n"- "\t1. PRODUCT, COLLECTION, CATEGORY use SPECIFIC_PRODUCT instead. "- "VALUE use ENTIRE_ORDER instead.\n"- "\t2. minAmountSpent use minSpentAmount instead"- )+ description=("Voucher type: PRODUCT, CATEGORY SHIPPING or ENTIRE_ORDER."))name = graphene.String(description="Voucher name.")code = graphene.String(decription="Code to use the voucher.")diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.pyindex c8a6d5090d..0fa81795fd 100644--- a/saleor/graphql/discount/types.py+++ b/saleor/graphql/discount/types.py@@ -103,7 +103,11 @@ class Voucher(CountableDjangoObjectType):)type = VoucherTypeEnum(description="Determines a type of voucher", required=True)min_amount_spent = graphene.Field(- types.Money, deprecation_reason="Use the minSpent field instead."+ types.Money,+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "use the minSpent field instead."+ ),)class Meta:diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex d4150f68af..39c9e2a9d1 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -308,7 +308,11 @@ class Order(CountableDjangoObjectType):description="Returns True, if order requires shipping.", required=True)discount_amount = graphene.Field(- Money, deprecation_reason="Deprecated: use discount instead.", required=True+ Money,+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, use discount instead."+ ),+ required=True,)class Meta:diff --git a/saleor/graphql/product/schema.py b/saleor/graphql/product/schema.pyindex b7d5b876cf..15dfe824bf 100644--- a/saleor/graphql/product/schema.py+++ b/saleor/graphql/product/schema.py@@ -187,13 +187,25 @@ class ProductQueries(graphene.ObjectType):Product,filter=ProductFilterInput(),attributes=graphene.List(- AttributeScalar, description="Filter products by attributes."+ AttributeScalar,+ description=(+ 'DEPRECATED: Will be removed in Saleor 2.10, use the "filter" input.',+ "Filter products by attributes.",+ ),),categories=graphene.List(- graphene.ID, description="Filter products by category."+ graphene.ID,+ description=(+ 'DEPRECATED: Will be removed in Saleor 2.10, use the "filter" input.',+ "Filter products by category.",+ ),),collections=graphene.List(- graphene.ID, description="Filter products by collections."+ graphene.ID,+ description=(+ 'DEPRECATED: Will be removed in Saleor 2.10, use the "filter" input.',+ "Filter products by collections.",+ ),),sort_by=graphene.Argument(ProductOrder, description="Sort products."),stock_availability=graphene.Argument(diff --git a/saleor/graphql/product/types/attributes.py b/saleor/graphql/product/types/attributes.pyindex e64482514a..6e263b8bba 100644--- a/saleor/graphql/product/types/attributes.py+++ b/saleor/graphql/product/types/attributes.py@@ -192,7 +192,9 @@ class SelectedAttribute(graphene.ObjectType):AttributeValue,default_value=None,description="The value or the first value of an attribute.",- deprecation_reason="Use values instead.",+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, use values instead."+ ),)values = graphene.List(AttributeValue, description="Values of an attribute.", required=Truediff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.pyindex 34cd350d80..09c00172cb 100644--- a/saleor/graphql/product/types/products.py+++ b/saleor/graphql/product/types/products.py@@ -124,7 +124,8 @@ class BasePricingInfo(graphene.ObjectType):available = graphene.Boolean(description="Whether it is in stock and visible or not.",deprecation_reason=(- "This has been moved to the parent type as 'is_available'."+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "this has been moved to the parent type as 'is_available'."),)on_sale = graphene.Boolean(description="Whether it is in sale or not.")@@ -189,13 +190,19 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):price = graphene.Field(Money,description="Price of the product variant.",- deprecation_reason=("Has been replaced by 'pricing.price_undiscounted'"),+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "has been replaced by 'pricing.price_undiscounted'"+ ),)availability = graphene.Field(VariantPricingInfo,description="""Informs about variant's availability in thestorefront, current price and discounted price.""",- deprecation_reason="Has been renamed to 'pricing'.",+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "has been renamed to 'pricing'."+ ),)pricing = graphene.Field(VariantPricingInfo,@@ -384,7 +391,10 @@ class Product(CountableDjangoObjectType, MetadataObjectType):ProductPricingInfo,description="""Informs about product's availability in thestorefront, current price and discounts.""",- deprecation_reason="Has been renamed to 'pricing'.",+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "Has been renamed to 'pricing'."+ ),)pricing = graphene.Field(ProductPricingInfo,@@ -398,7 +408,10 @@ class Product(CountableDjangoObjectType, MetadataObjectType):price = graphene.Field(Money,description="The product's default base price.",- deprecation_reason=("Has been replaced by 'basePrice'"),+ deprecation_reason=(+ "DEPRECATED: Will be removed in Saleor 2.10, "+ "has been replaced by 'basePrice'"+ ),)minimal_variant_price = graphene.Field(Money, description="The price of the cheapest variant (including discounts)."diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex d2794509b7..003086176a 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -516,7 +516,7 @@ type Checkout implements Node {shippingAddress: AddressshippingMethod: ShippingMethodnote: String!- discountAmount: Money @deprecated(reason: "Use discount instead.")+ discountAmount: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use discount instead.")discount: MoneydiscountName: StringtranslatedDiscountName: String@@ -2041,7 +2041,7 @@ type Order implements Node {totalBalance: Money!userEmail: StringisShippingRequired: Boolean!- discountAmount: Money! @deprecated(reason: "Deprecated: use discount instead.")+ discountAmount: Money! @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use discount instead.")}enum OrderAction {@@ -2495,11 +2495,11 @@ type Product implements Node {meta: [MetaStore]!url: String!thumbnail(size: Int): Image- availability: ProductPricingInfo @deprecated(reason: "Has been renamed to 'pricing'.")+ availability: ProductPricingInfo @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, Has been renamed to 'pricing'.")pricing: ProductPricingInfoisAvailable: BooleanbasePrice: Money- price: Money @deprecated(reason: "Has been replaced by 'basePrice'")+ price: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, has been replaced by 'basePrice'")minimalVariantPrice: MoneytaxType: TaxTypeattributes: [SelectedAttribute!]!@@ -2664,7 +2664,7 @@ enum ProductOrderField {}type ProductPricingInfo {- available: Boolean @deprecated(reason: "This has been moved to the parent type as 'is_available'.")+ available: Boolean @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, this has been moved to the parent type as 'is_available'.")onSale: Booleandiscount: TaxedMoneydiscountLocalCurrency: TaxedMoney@@ -2816,8 +2816,8 @@ type ProductVariant implements Node {meta: [MetaStore]!stockQuantity: Int!priceOverride: Money- price: Money @deprecated(reason: "Has been replaced by 'pricing.price_undiscounted'")- availability: VariantPricingInfo @deprecated(reason: "Has been renamed to 'pricing'.")+ price: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, has been replaced by 'pricing.price_undiscounted'")+ availability: VariantPricingInfo @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, has been renamed to 'pricing'.")pricing: VariantPricingInfoisAvailable: Booleanattributes: [SelectedAttribute!]!@@ -3083,7 +3083,7 @@ type SaleUpdate {type SelectedAttribute {attribute: Attribute!- value: AttributeValue @deprecated(reason: "Use values instead.")+ value: AttributeValue @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use values instead.")values: [AttributeValue]!}@@ -3565,7 +3565,7 @@ type VariantImageUnassign {}type VariantPricingInfo {- available: Boolean @deprecated(reason: "This has been moved to the parent type as 'is_available'.")+ available: Boolean @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, this has been moved to the parent type as 'is_available'.")onSale: Booleandiscount: TaxedMoneydiscountLocalCurrency: TaxedMoney@@ -3599,7 +3599,7 @@ type Voucher implements Node {products(before: String, after: String, first: Int, last: Int): ProductCountableConnectioncountries: [CountryDisplay]translation(languageCode: LanguageCodeEnum!): VoucherTranslation- minAmountSpent: Money @deprecated(reason: "Use the minSpent field instead.")+ minAmountSpent: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, use the minSpent field instead.")}type VoucherAddCatalogues {