Skip to content

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

Add missing descriptions to checkout types (#13167)

Filip Owczarekc8fe92b4c133
diff --git a/CHANGELOG.md b/CHANGELOG.md
index de38e6efdf..a9bd15eef2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -22,8 +22,9 @@ All notable, unreleased changes to this project will be documented in this file.
- Remove unused `google-measurement-protocol` package - #13146 by @SzymJ
- Add missing descriptions to App module. - #13163 by @fowczarek
- Drop TranslationProxy and replace `translated` model property with `get_translation` function where needed. - #13156 by @zedzior
-- Add missing descriptions to Account module. - #13155 by @fowczarek
+- Add missing descriptions to account module. - #13155 by @fowczarek
- Add missing descriptions to channel module. - #13166 by @fowczarek
+- Add missing descriptions to checkout module. - #13167 by @fowczarek
- Add missing descriptions to attribute module. - #13165 by @fowczarek
# 3.14.0
diff --git a/saleor/graphql/checkout/types.py b/saleor/graphql/checkout/types.py
index 64d004bb0a..9373ae7609 100644
--- a/saleor/graphql/checkout/types.py
+++ b/saleor/graphql/checkout/types.py
@@ -132,11 +132,16 @@ class PaymentGateway(BaseObjectType):
class CheckoutLine(ModelObjectType[models.CheckoutLine]):
- id = graphene.GlobalID(required=True)
+ id = graphene.GlobalID(required=True, description="The ID of the checkout line.")
variant = graphene.Field(
- "saleor.graphql.product.types.ProductVariant", required=True
+ "saleor.graphql.product.types.ProductVariant",
+ required=True,
+ description="The product variant from which the checkout line was created.",
+ )
+ quantity = graphene.Int(
+ required=True,
+ description="The quantity of product variant assigned to the checkout line.",
)
- quantity = graphene.Int(required=True)
unit_price = graphene.Field(
TaxedMoney,
description="The unit price of the checkout line, with taxes and discounts.",
@@ -361,8 +366,10 @@ class DeliveryMethod(graphene.Union):
class Checkout(ModelObjectType[models.Checkout]):
- id = graphene.ID(required=True)
- created = graphene.DateTime(required=True)
+ id = graphene.ID(required=True, description="The ID of the checkout.")
+ created = graphene.DateTime(
+ required=True, description="The date and time when the checkout was created."
+ )
updated_at = graphene.DateTime(
required=True,
description=("Time of last modification of the given checkout." + ADDED_IN_313),
@@ -371,15 +378,45 @@ class Checkout(ModelObjectType[models.Checkout]):
required=True,
deprecation_reason=(f"{DEPRECATED_IN_3X_FIELD} Use `updatedAt` instead."),
)
- user = graphene.Field("saleor.graphql.account.types.User")
- channel = graphene.Field(Channel, required=True)
- billing_address = graphene.Field("saleor.graphql.account.types.Address")
- shipping_address = graphene.Field("saleor.graphql.account.types.Address")
- note = graphene.String(required=True)
- discount = graphene.Field(Money)
- discount_name = graphene.String()
- translated_discount_name = graphene.String()
- voucher_code = graphene.String()
+ user = graphene.Field(
+ "saleor.graphql.account.types.User",
+ description="The user assigned to the checkout.",
+ )
+ channel = graphene.Field(
+ Channel,
+ required=True,
+ description="The channel for which checkout was created.",
+ )
+ billing_address = graphene.Field(
+ "saleor.graphql.account.types.Address",
+ description="The billing address of the checkout.",
+ )
+ shipping_address = graphene.Field(
+ "saleor.graphql.account.types.Address",
+ description="The shipping address of the checkout.",
+ )
+ note = graphene.String(required=True, description="The note for the checkout.")
+ discount = graphene.Field(
+ Money,
+ description=(
+ "The total discount applied to the checkout. "
+ "Note: Only discount created via voucher are included in this field."
+ ),
+ )
+ discount_name = graphene.String(
+ description="The name of voucher assigned to the checkout."
+ )
+ translated_discount_name = graphene.String(
+ description=(
+ "Translation of the discountName field in the language "
+ "set in Checkout.languageCode field."
+ "Note: this field is set automatically when "
+ "Checkout.languageCode is defined; otherwise it's null"
+ )
+ )
+ voucher_code = graphene.String(
+ description="The code of voucher assigned to the checkout."
+ )
available_shipping_methods = NonNullList(
ShippingMethod,
required=True,
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index ecedc94abd..50a21e0c01 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -9626,6 +9626,7 @@ type User implements Node & ObjectWithMetadata @doc(category: "Users") {
"""Checkout object."""
type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {
+ """The ID of the checkout."""
id: ID!
"""List of private metadata items. Requires staff permissions to access."""
@@ -9673,6 +9674,8 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {
Note: this API is currently in Feature Preview and can be subject to changes at later point.
"""
metafields(keys: [String!]): Metadata
+
+ """The date and time when the checkout was created."""
created: DateTime!
"""
@@ -9682,14 +9685,36 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {
"""
updatedAt: DateTime!
lastChange: DateTime! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `updatedAt` instead.")
+
+ """The user assigned to the checkout."""
user: User
+
+ """The channel for which checkout was created."""
channel: Channel!
+
+ """The billing address of the checkout."""
billingAddress: Address
+
+ """The shipping address of the checkout."""
shippingAddress: Address
+
+ """The note for the checkout."""
note: String!
+
+ """
+ The total discount applied to the checkout. Note: Only discount created via voucher are included in this field.
+ """
discount: Money
+
+ """The name of voucher assigned to the checkout."""
discountName: String
+
+ """
+ Translation of the discountName field in the language set in Checkout.languageCode field.Note: this field is set automatically when Checkout.languageCode is defined; otherwise it's null
+ """
translatedDiscountName: String
+
+ """The code of voucher assigned to the checkout."""
voucherCode: String
"""Shipping methods that can be used with this checkout."""
@@ -10064,6 +10089,7 @@ type GiftCardTag implements Node @doc(category: "Gift cards") {
"""Represents an item in the checkout."""
type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout") {
+ """The ID of the checkout line."""
id: ID!
"""
@@ -10123,7 +10149,11 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout"
Note: this API is currently in Feature Preview and can be subject to changes at later point.
"""
metafields(keys: [String!]): Metadata
+
+ """The product variant from which the checkout line was created."""
variant: ProductVariant!
+
+ """The quantity of product variant assigned to the checkout line."""
quantity: Int!
"""The unit price of the checkout line, with taxes and discounts."""