Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add type enum to Voucher graphene's object
Maciej Korycinski672e1e61db51
diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.pyindex 87bad60989..fe541b2c3d 100644--- a/saleor/graphql/discount/types.py+++ b/saleor/graphql/discount/types.py@@ -10,7 +10,7 @@ from ..product.types import Category, Collection, Productfrom ..translations.enums import LanguageCodeEnumfrom ..translations.resolvers import resolve_translationfrom ..translations.types import SaleTranslation, VoucherTranslation-from .enums import DiscountValueTypeEnum+from .enums import DiscountValueTypeEnum, VoucherTypeEnumclass Sale(CountableDjangoObjectType):@@ -98,8 +98,10 @@ class Voucher(CountableDjangoObjectType):resolver=resolve_translation,)discount_value_type = DiscountValueTypeEnum(- description="Determines a type of voucher - value or percentage", required=True+ description="Determines a type of discount for voucher - value or percentage",+ required=True,)+ type = VoucherTypeEnum(description="Determines a type of voucher", required=True)class Meta:description = """diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 7d74cd3124..13bdd8378e 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3102,7 +3102,7 @@ type VerifyToken {type Voucher implements Node {id: ID!- type: VoucherType!+ type: VoucherTypeEnum!name: Stringcode: String!usageLimit: Int@@ -3198,15 +3198,6 @@ type VoucherTranslation implements Node {language: LanguageDisplay!}-enum VoucherType {- ENTIRE_ORDER- PRODUCT- COLLECTION- CATEGORY- SHIPPING- SPECIFIC_PRODUCT-}-enum VoucherTypeEnum {PRODUCTCOLLECTION