Skip to content

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

Support query products by update date

Unknown9bee97e094c1
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py
index 3da24b4ab6..f4ecbad443 100644
--- a/saleor/graphql/product/types.py
+++ b/saleor/graphql/product/types.py
@@ -46,12 +46,18 @@ class StockAvailability(graphene.Enum):
class ProductOrderField(graphene.Enum):
NAME = 'name'
PRICE = 'price'
+ DATE = 'updated_at'
@property
def description(self):
if self == ProductOrderField.NAME:
return 'Sort products by name.'
- return 'Sort products by price.'
+
+ if self == ProductOrderField.PRICE:
+ return 'Sort products by price.'
+
+ if self == ProductOrderField.DATE:
+ return 'Sort products by update date.'
class OrderDirection(graphene.Enum):