Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Update description for deprecated fields

Mira Szewczykaa334cd5a3b1
diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.py
index 546ed41ce0..1302e302d2 100644
--- a/saleor/graphql/product/types/products.py
+++ b/saleor/graphql/product/types/products.py
@@ -196,15 +196,22 @@ class ProductPricingInfo(BasePricingInfo):
class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
quantity = graphene.Int(
required=True,
- description="DEPRECATED: Will be removed in favour of stock. "
- "Quantity of a product in the store's possession, "
+ description="Quantity of a product in the store's possession, "
"including the allocated stock that is waiting for shipment.",
+ deprecation_reason="This field will be removed in Saleor 2.11. "
+ "Use the stock field instead.",
+ )
+ quantity_allocated = graphene.Int(
+ required=False,
+ description="Quantity allocated for orders",
+ deprecation_reason="This field will be removed in Saleor 2.11. "
+ "Use the stock field instead.",
)
- quantity_allocated = graphene.Int(required=False, description="DEPRECATED")
stock_quantity = graphene.Int(
required=True,
- description="DEPRECATED: Will be removed in favour to stock. "
- "Quantity of a product available for sale.",
+ description="Quantity of a product available for sale.",
+ deprecation_reason="This field will be removed in Saleor 2.11. "
+ "Use the stock field instead.",
)
price_override = graphene.Field(
Money,
@@ -221,8 +228,9 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):
),
)
is_available = graphene.Boolean(
- description="DEPRECATED: Will be removed in favour of stock. "
- "Whether the variant is in stock and visible or not."
+ description="Whether the variant is in stock and visible or not.",
+ deprecation_reason="This field will be removed in Saleor 2.11. "
+ "Use the stock field instead.",
)
attributes = gql_optimizer.field(
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 290a7667ae..1395573af9 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3356,12 +3356,12 @@ type ProductVariant implements Node {
weight: Weight
privateMeta: [MetaStore]!
meta: [MetaStore]!
- quantity: Int!
- quantityAllocated: Int
- stockQuantity: Int!
+ quantity: Int! @deprecated(reason: "This field will be removed in Saleor 2.11. Use the stock field instead.")
+ quantityAllocated: Int @deprecated(reason: "This field will be removed in Saleor 2.11. Use the stock field instead.")
+ stockQuantity: Int! @deprecated(reason: "This field will be removed in Saleor 2.11. Use the stock field instead.")
priceOverride: Money
pricing: VariantPricingInfo
- isAvailable: Boolean
+ isAvailable: Boolean @deprecated(reason: "This field will be removed in Saleor 2.11. Use the stock field instead.")
attributes: [SelectedAttribute!]!
costPrice: Money
margin: Int