Skip to content

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

Add description to enums

fowczarek7f0f12f2f326
diff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.py
index b607f044df..94a4c27ef5 100644
--- a/saleor/graphql/product/types.py
+++ b/saleor/graphql/product/types.py
@@ -46,11 +46,23 @@ class ProductOrderField(graphene.Enum):
NAME = 'name'
PRICE = 'price'
+ @property
+ def description(self):
+ if self == ProductOrderField.NAME:
+ return 'Sort products by name.'
+ return 'Sort products by price.'
+
class OrderDirection(graphene.Enum):
ASC = ''
DESC = '-'
+ @property
+ def description(self):
+ if self == OrderDirection.ASC:
+ return 'Specifies an ascending sort order.'
+ return 'Specifies a descending sort order.'
+
def resolve_attribute_list(attributes_hstore, attributes_qs):
"""Resolve attributes dict into a list of `SelectedAttribute`s.