Skip to content

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

Added missing descrption to giftcard module. (#14847)

Bhuvnesh3a599ce46d14
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 943fdd6255..45680ed49a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -398,6 +398,7 @@ Shipping methods can be removed by the user after it has been assigned to a chec
- Add missing descriptions to payment module - #13546 by @devilsautumn
- Fix `NOTIFY_USER` allow to create webhook with only one event - #13584 by @Air-t
- Add Index for 'Created' field of the Order Model - #13682 by @ritanjandawn
+- Add missing descriptions to giftcard module - #14847 by @devilsautumn
# 3.14.0
diff --git a/saleor/graphql/giftcard/types.py b/saleor/graphql/giftcard/types.py
index dcf5d65f01..f3d940e29a 100644
--- a/saleor/graphql/giftcard/types.py
+++ b/saleor/graphql/giftcard/types.py
@@ -65,7 +65,9 @@ class GiftCardEventBalance(BaseObjectType):
class GiftCardEvent(ModelObjectType[models.GiftCardEvent]):
- id = graphene.GlobalID(required=True)
+ id = graphene.GlobalID(
+ required=True, description="ID of the event associated with a gift card."
+ )
date = graphene.types.datetime.DateTime(
description="Date when event happened at in ISO 8601 format."
)
@@ -215,8 +217,12 @@ class GiftCardEvent(ModelObjectType[models.GiftCardEvent]):
class GiftCardTag(ModelObjectType[models.GiftCardTag]):
- id = graphene.GlobalID(required=True)
- name = graphene.String(required=True)
+ id = graphene.GlobalID(
+ required=True, description="ID of the tag associated with a gift card."
+ )
+ name = graphene.String(
+ required=True, description="Name of the tag associated with a gift card."
+ )
class Meta:
description = "The gift card tag." + ADDED_IN_31
@@ -225,7 +231,7 @@ class GiftCardTag(ModelObjectType[models.GiftCardTag]):
class GiftCard(ModelObjectType[models.GiftCard]):
- id = graphene.GlobalID(required=True)
+ id = graphene.GlobalID(required=True, description="ID of the gift card.")
display_code = graphene.String(
description="Code in format which allows displaying in a user interface.",
required=True,
@@ -245,7 +251,9 @@ class GiftCard(ModelObjectType[models.GiftCard]):
),
required=True,
)
- created = graphene.DateTime(required=True)
+ created = graphene.DateTime(
+ required=True, description="Date and time when gift card was created."
+ )
created_by = graphene.Field(
"saleor.graphql.account.types.User",
description=("The user who bought or issued a gift card." + ADDED_IN_31),
@@ -272,8 +280,10 @@ class GiftCard(ModelObjectType[models.GiftCard]):
),
deprecation_reason=DEPRECATED_IN_3X_FIELD,
)
- last_used_on = graphene.DateTime()
- expiry_date = Date()
+ last_used_on = graphene.DateTime(
+ description="Date and time when gift card was last used."
+ )
+ expiry_date = Date(description="Expiry date of the gift card.")
app = graphene.Field(
App,
description=(
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 20a245dc33..f18fa631f6 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -10809,6 +10809,7 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {
A gift card is a prepaid electronic payment card accepted in stores. They can be used during checkout by providing a valid gift card codes.
"""
type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards") {
+ """ID of the gift card."""
id: ID!
"""List of private metadata items. Requires staff permissions to access."""
@@ -10861,6 +10862,8 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards")
Requires one of the following permissions: MANAGE_GIFT_CARD, OWNER.
"""
code: String!
+
+ """Date and time when gift card was created."""
created: DateTime!
"""
@@ -10892,7 +10895,11 @@ type GiftCard implements Node & ObjectWithMetadata @doc(category: "Gift cards")
Added in Saleor 3.1.
"""
usedByEmail: String @deprecated(reason: "This field will be removed in Saleor 4.0.")
+
+ """Date and time when gift card was last used."""
lastUsedOn: DateTime
+
+ """Expiry date of the gift card."""
expiryDate: Date
"""
@@ -10958,6 +10965,7 @@ History log of the gift card.
Added in Saleor 3.1.
"""
type GiftCardEvent implements Node @doc(category: "Gift cards") {
+ """ID of the event associated with a gift card."""
id: ID!
"""Date when event happened at in ISO 8601 format."""
@@ -11045,7 +11053,10 @@ The gift card tag.
Added in Saleor 3.1.
"""
type GiftCardTag implements Node @doc(category: "Gift cards") {
+ """ID of the tag associated with a gift card."""
id: ID!
+
+ """Name of the tag associated with a gift card."""
name: String!
}