Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add discount_value_type to Voucher graphene's object
Maciej Korycinskid85dfc959f72
diff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.pyindex 1143f3aff9..87bad60989 100644--- a/saleor/graphql/discount/types.py+++ b/saleor/graphql/discount/types.py@@ -10,6 +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 DiscountValueTypeEnumclass Sale(CountableDjangoObjectType):@@ -96,6 +97,9 @@ class Voucher(CountableDjangoObjectType):description="Returns translated Voucher fields for the given language code.",resolver=resolve_translation,)+ discount_value_type = DiscountValueTypeEnum(+ description="Determines a type of voucher - value or percentage", required=True+ )class Meta:description = """diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex d7ce9975e9..7d74cd3124 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3110,7 +3110,7 @@ type Voucher implements Node {startDate: DateTime!endDate: DateTimeapplyOncePerOrder: Boolean!- discountValueType: VoucherDiscountValueType!+ discountValueType: DiscountValueTypeEnum!discountValue: Float!minAmountSpent: Moneycategories(before: String, after: String, first: Int, last: Int): CategoryCountableConnection@@ -3157,11 +3157,6 @@ enum VoucherDiscountType {SHIPPING}-enum VoucherDiscountValueType {- FIXED- PERCENTAGE-}-input VoucherFilterInput {status: [DiscountStatusEnum]timesUsed: IntRangeInput