Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Remove price and availability from Product and ProductVariant
IKarbowiak350a7a536b9c
diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.pyindex dd394be8ab..1733a2667f 100644--- a/saleor/graphql/product/types/products.py+++ b/saleor/graphql/product/types/products.py@@ -202,24 +202,6 @@ class ProductVariant(CountableDjangoObjectType, MetadataObjectType):"indicates that the default product price is used."),)- price = graphene.Field(- Money,- description="Price of the product variant.",- deprecation_reason=(- "DEPRECATED: Will be removed in Saleor 2.10, "- "has been replaced by 'pricing.priceUndiscounted'"- ),- )- availability = graphene.Field(- VariantPricingInfo,- description=(- "Informs about variant's availability in the storefront, current price and "- "discounted price."- ),- deprecation_reason=(- "DEPRECATED: Will be removed in Saleor 2.10, has been renamed to `pricing`."- ),- )pricing = graphene.Field(VariantPricingInfo,description=(@@ -404,16 +386,6 @@ class Product(CountableDjangoObjectType, MetadataObjectType):description="The main thumbnail for a product.",size=graphene.Argument(graphene.Int, description="Size of thumbnail."),)- availability = graphene.Field(- ProductPricingInfo,- description=(- "Informs about product's availability in the storefront, current price and "- "discounts."- ),- deprecation_reason=(- "DEPRECATED: Will be removed in Saleor 2.10, Has been renamed to `pricing`."- ),- )pricing = graphene.Field(ProductPricingInfo,description=(@@ -425,14 +397,6 @@ class Product(CountableDjangoObjectType, MetadataObjectType):description="Whether the product is in stock and visible or not.")base_price = graphene.Field(Money, description="The product's default base price.")- price = graphene.Field(- Money,- description="The product's default base price.",- 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 2ca3c5ee5f..9c725e4d93 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -2955,11 +2955,9 @@ type Product implements Node {meta: [MetaStore]!url: String!thumbnail(size: Int): Image- 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: "DEPRECATED: Will be removed in Saleor 2.10, has been replaced by `basePrice`")minimalVariantPrice: MoneytaxType: TaxTypeattributes: [SelectedAttribute!]!@@ -3344,8 +3342,6 @@ type ProductVariant implements Node {quantity: Int!stockQuantity: Int!priceOverride: Money- price: Money @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, has been replaced by 'pricing.priceUndiscounted'")- availability: VariantPricingInfo @deprecated(reason: "DEPRECATED: Will be removed in Saleor 2.10, has been renamed to `pricing`.")pricing: VariantPricingInfoisAvailable: Booleanattributes: [SelectedAttribute!]!diff --git a/tests/api/benchmark/test_checkout.py b/tests/api/benchmark/test_checkout.pyindex 1ef2dfc5d8..7841e0f00e 100644--- a/tests/api/benchmark/test_checkout.py+++ b/tests/api/benchmark/test_checkout.py@@ -74,10 +74,35 @@ def test_create_checkout(api_client, graphql_address_data, variant, count_queriefragment ProductVariant on ProductVariant {idname- price {- amount- currency- localized+ pricing {+ discountLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }+ price {+ currency+ gross {+ amount+ localized+ }+ }+ priceUndiscounted {+ currency+ gross {+ amount+ localized+ }+ }+ priceLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }}product {id@@ -213,10 +238,35 @@ def test_add_shipping_to_checkout(fragment ProductVariant on ProductVariant {idname- price {- amount- currency- localized+ pricing {+ discountLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }+ price {+ currency+ gross {+ amount+ localized+ }+ }+ priceUndiscounted {+ currency+ gross {+ amount+ localized+ }+ }+ priceLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }}product {id@@ -345,10 +395,35 @@ def test_add_billing_address_to_checkout(fragment ProductVariant on ProductVariant {idname- price {- amount- currency- localized+ pricing {+ discountLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }+ price {+ currency+ gross {+ amount+ localized+ }+ }+ priceUndiscounted {+ currency+ gross {+ amount+ localized+ }+ }+ priceLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }}product {iddiff --git a/tests/api/benchmark/test_product.py b/tests/api/benchmark/test_product.pyindex 3a77ba33c9..13bd2d6d98 100644--- a/tests/api/benchmark/test_product.py+++ b/tests/api/benchmark/test_product.py@@ -26,10 +26,35 @@ def test_product_details(product, api_client, count_queries):namestockQuantityisAvailable- price {- currency- amount- localized+ pricing {+ discountLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }+ price {+ currency+ gross {+ amount+ localized+ }+ }+ priceUndiscounted {+ currency+ gross {+ amount+ localized+ }+ }+ priceLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }}attributes {attribute {@@ -59,20 +84,60 @@ def test_product_details(product, api_client, count_queries):idname}- price {- amount- currency- localized+ pricing {+ priceRange {+ start{+ currency+ gross {+ amount+ localized+ }+ }+ stop{+ currency+ gross {+ amount+ localized+ }+ }+ }+ priceRangeUndiscounted {+ start{+ currency+ gross {+ amount+ localized+ }+ }+ stop{+ currency+ gross {+ amount+ localized+ }+ }+ }+ priceRangeLocalCurrency {+ start{+ currency+ gross {+ amount+ localized+ }+ }+ stop{+ currency+ gross {+ amount+ localized+ }+ }+ }}}}}}- price {- amount- currency- localized- }images {idurldiff --git a/tests/api/benchmark/test_variant.py b/tests/api/benchmark/test_variant.pyindex 600cbf6c7f..8c5f83d6a3 100644--- a/tests/api/benchmark/test_variant.py+++ b/tests/api/benchmark/test_variant.py@@ -29,10 +29,35 @@ def test_retrieve_variant_list(product_variant_list, api_client, count_queries):namestockQuantityisAvailable- price {- currency- amount- localized+ pricing {+ discountLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }+ price {+ currency+ gross {+ amount+ localized+ }+ }+ priceUndiscounted {+ currency+ gross {+ amount+ localized+ }+ }+ priceLocalCurrency {+ currency+ gross {+ amount+ localized+ }+ }}attributes {attribute {