Skip to content

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

Improve GiftCard money typing (#10294)

Marcin Gębalab2735ebd6bc7
diff --git a/saleor/graphql/giftcard/types.py b/saleor/graphql/giftcard/types.py
index 59f3ab05ae..359f4f7ffe 100644
--- a/saleor/graphql/giftcard/types.py
+++ b/saleor/graphql/giftcard/types.py
@@ -323,8 +323,8 @@ class GiftCard(ModelObjectType):
required=False,
)
is_active = graphene.Boolean(required=True)
- initial_balance = graphene.Field(Money)
- current_balance = graphene.Field(Money)
+ initial_balance = graphene.Field(Money, required=True)
+ current_balance = graphene.Field(Money, required=True)
# DEPRECATED
user = graphene.Field(
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 9d19039d70..b90e5f6801 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -8032,8 +8032,8 @@ type GiftCard implements Node & ObjectWithMetadata {
"""
boughtInChannel: String
isActive: Boolean!
- initialBalance: Money
- currentBalance: Money
+ initialBalance: Money!
+ currentBalance: Money!
"""The customer who bought a gift card."""
user: User @deprecated(reason: "This field will be removed in Saleor 4.0. Use `createdBy` field instead.")