Skip to content

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

Added description for warehouse types. (#13264)

Smit Parmar0e2a539650df
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bea4ecbd81..6923933b31 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -87,6 +87,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Add `ACCOUNT_CONFIRMATION_REQUESTED` async event - #13162 by @SzymJ
- Add `ACCOUNT_DELETE_REQUESTED` async event - #13170 by @SzymJ
- Add `ACCOUNT_CHANGE_EMAIL_REQUESTED` async event - #13233 by @SzymJ
+- Add missing descriptions to Warehouse module. - #13264 by @Smit-Parmar
# 3.14.0
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 6debc3d4c9..08900ee986 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3459,6 +3459,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") {
"""Represents warehouse."""
type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") {
+ """The ID of the warehouse."""
id: ID!
"""List of private metadata items. Requires staff permissions to access."""
@@ -3498,10 +3499,20 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") {
Added in Saleor 3.3.
"""
metafields(keys: [String!]): Metadata
+
+ """Warehouse name."""
name: String!
+
+ """Warehouse slug."""
slug: String!
+
+ """Warehouse email."""
email: String!
+
+ """Determine if the warehouse is private."""
isPrivate: Boolean!
+
+ """Address of the warehouse."""
address: Address!
"""Warehouse company name."""
@@ -3513,6 +3524,8 @@ type Warehouse implements Node & ObjectWithMetadata @doc(category: "Products") {
Added in Saleor 3.1.
"""
clickAndCollectOption: WarehouseClickAndCollectOptionEnum!
+
+ """Shipping zones supported by the warehouse."""
shippingZones(
"""Return the elements in the list that come before the specified cursor."""
before: String
@@ -7330,8 +7343,13 @@ scalar UUID
"""Represents stock."""
type Stock implements Node @doc(category: "Products") {
+ """The ID of stock."""
id: ID!
+
+ """The warehouse associated with the stock."""
warehouse: Warehouse!
+
+ """Information about the product variant."""
productVariant: ProductVariant!
"""
@@ -10839,6 +10857,7 @@ scalar PositiveDecimal
"""Represents allocation."""
type Allocation implements Node @doc(category: "Products") {
+ """The ID of allocation."""
id: ID!
"""
diff --git a/saleor/graphql/warehouse/types.py b/saleor/graphql/warehouse/types.py
index 54b87092ab..aa34f0ae53 100644
--- a/saleor/graphql/warehouse/types.py
+++ b/saleor/graphql/warehouse/types.py
@@ -83,12 +83,18 @@ class WarehouseUpdateInput(WarehouseInput):
class Warehouse(ModelObjectType[models.Warehouse]):
- id = graphene.GlobalID(required=True)
- name = graphene.String(required=True)
- slug = graphene.String(required=True)
- email = graphene.String(required=True)
- is_private = graphene.Boolean(required=True)
- address = graphene.Field("saleor.graphql.account.types.Address", required=True)
+ id = graphene.GlobalID(required=True, description="The ID of the warehouse.")
+ name = graphene.String(required=True, description="Warehouse name.")
+ slug = graphene.String(required=True, description="Warehouse slug.")
+ email = graphene.String(required=True, description="Warehouse email.")
+ is_private = graphene.Boolean(
+ required=True, description="Determine if the warehouse is private."
+ )
+ address = graphene.Field(
+ "saleor.graphql.account.types.Address",
+ required=True,
+ description="Address of the warehouse.",
+ )
company_name = graphene.String(
required=True,
description="Warehouse company name.",
@@ -105,6 +111,7 @@ class Warehouse(ModelObjectType[models.Warehouse]):
shipping_zones = ConnectionField(
"saleor.graphql.shipping.types.ShippingZoneCountableConnection",
required=True,
+ description="Shipping zones supported by the warehouse.",
)
external_reference = graphene.String(
description=f"External ID of this warehouse. {ADDED_IN_310}", required=False
@@ -159,10 +166,14 @@ class WarehouseCountableConnection(CountableConnection):
class Stock(ModelObjectType[models.Stock]):
- id = graphene.GlobalID(required=True)
- warehouse = graphene.Field(Warehouse, required=True)
+ id = graphene.GlobalID(required=True, description="The ID of stock.")
+ warehouse = graphene.Field(
+ Warehouse, required=True, description="The warehouse associated with the stock."
+ )
product_variant = graphene.Field(
- "saleor.graphql.product.types.ProductVariant", required=True
+ "saleor.graphql.product.types.ProductVariant",
+ required=True,
+ description="Information about the product variant.",
)
quantity = PermissionsField(
graphene.Int,
@@ -248,7 +259,7 @@ class StockCountableConnection(CountableConnection):
class Allocation(BaseObjectType):
- id = graphene.GlobalID(required=True)
+ id = graphene.GlobalID(required=True, description="The ID of allocation.")
quantity = PermissionsField(
graphene.Int,
required=True,