Skip to content

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

Add deprecate decription to orders status/created args

Krzysztof Świątekba8dd67859d3
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b3fc68f832..9863e70dc0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -43,6 +43,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add `checkout_quantity_changed` webhook - #5042 by @derenio
- Remove unnecessary manage_orders permission - #5142 by @kswiatek92
- Mutation to change user email - #5076 by @kswiatek92
+- Add deprecate description to order status/created arguments - #5076 by @kswiatek92
## 2.9.0
diff --git a/saleor/graphql/order/resolvers.py b/saleor/graphql/order/resolvers.py
index 69ecb0d7ae..6f6902204b 100644
--- a/saleor/graphql/order/resolvers.py
+++ b/saleor/graphql/order/resolvers.py
@@ -17,6 +17,7 @@ ORDER_SEARCH_FIELDS = ("id", "discount_name", "token", "user_email", "user__emai
def filter_orders(qs, info, created, status, query):
qs = filter_by_query_param(qs, query, ORDER_SEARCH_FIELDS)
+ # DEPRECATED: Will be removed in Saleor 2.11, use the `filter` field instead.
# filter orders by status
if status is not None:
if status == OrderStatusFilter.READY_TO_FULFILL:
@@ -24,6 +25,7 @@ def filter_orders(qs, info, created, status, query):
elif status == OrderStatusFilter.READY_TO_CAPTURE:
qs = qs.ready_to_capture()
+ # DEPRECATED: Will be removed in Saleor 2.11, use the `filter` field instead.
# filter orders by creation date
if created is not None:
qs = filter_by_period(qs, created, "created")
diff --git a/saleor/graphql/order/schema.py b/saleor/graphql/order/schema.py
index 6f26c99f9b..13eea241cd 100644
--- a/saleor/graphql/order/schema.py
+++ b/saleor/graphql/order/schema.py
@@ -82,10 +82,20 @@ class OrderQueries(graphene.ObjectType):
sort_by=OrderSortingInput(description="Sort orders."),
filter=OrderFilterInput(description="Filtering options for orders."),
created=graphene.Argument(
- ReportingPeriod, description="Filter orders from a selected timespan."
+ ReportingPeriod,
+ description=(
+ "Filter orders from a selected timespan. "
+ "DEPRECATED: Will be removed in Saleor 2.11, "
+ "use the `filter` field instead."
+ ),
),
status=graphene.Argument(
- OrderStatusFilter, description="Filter order by status."
+ OrderStatusFilter,
+ description=(
+ "Filter order by status. "
+ "DEPRECATED: Will be removed in Saleor 2.11, "
+ "use the `filter` field instead."
+ ),
),
description="List of orders.",
)
@@ -94,7 +104,12 @@ class OrderQueries(graphene.ObjectType):
sort_by=OrderSortingInput(description="Sort draft orders."),
filter=OrderDraftFilterInput(description="Filtering options for draft orders."),
created=graphene.Argument(
- ReportingPeriod, description="Filter draft orders from a selected timespan."
+ ReportingPeriod,
+ description=(
+ "Filter draft orders from a selected timespan. "
+ "DEPRECATED: Will be removed in Saleor 2.11, "
+ "use the `filter` field instead."
+ ),
),
description="List of draft orders.",
)
diff --git a/saleor/graphql/product/schema.py b/saleor/graphql/product/schema.py
index 1c93124bc1..2373abf39a 100644
--- a/saleor/graphql/product/schema.py
+++ b/saleor/graphql/product/schema.py
@@ -194,7 +194,12 @@ class ProductQueries(graphene.ObjectType):
filter=ProductFilterInput(description="Filtering options for products."),
sort_by=ProductOrder(description="Sort products."),
stock_availability=graphene.Argument(
- StockAvailability, description="Filter products by stock availability."
+ StockAvailability,
+ description=(
+ "Filter products by stock availability."
+ "DEPRECATED: Will be removed in Saleor 2.11, "
+ "use the `filter` field instead."
+ ),
),
description="List of the shop's products.",
)