Skip to content

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

Add description field to ShippingMethodTranslatableContent type

IKarbowiakd2fdf07bad61
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index f02e5d72f3..329386dc68 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -4911,11 +4911,11 @@ enum ShippingErrorCode {
type ShippingMethod implements Node & ObjectWithMetadata {
id: ID!
name: String!
+ description: JSONString
minimumOrderWeight: Weight
maximumOrderWeight: Weight
maximumDeliveryDays: Int
minimumDeliveryDays: Int
- description: JSONString
privateMetadata: [MetadataItem]!
metadata: [MetadataItem]!
type: ShippingMethodTypeEnum
@@ -4964,6 +4964,7 @@ type ShippingMethodPostalCodeRule implements Node {
type ShippingMethodTranslatableContent implements Node {
id: ID!
name: String!
+ description: JSONString
translation(languageCode: LanguageCodeEnum!): ShippingMethodTranslation
shippingMethod: ShippingMethod
}
diff --git a/saleor/graphql/translations/tests/test_translations.py b/saleor/graphql/translations/tests/test_translations.py
index 6182a32ff5..03e3396022 100644
--- a/saleor/graphql/translations/tests/test_translations.py
+++ b/saleor/graphql/translations/tests/test_translations.py
@@ -1966,6 +1966,7 @@ QUERY_TRANSLATION_SHIPPING_METHOD = """
...on ShippingMethodTranslatableContent{
id
name
+ description
translation(languageCode: $languageCode){
name
}
@@ -2009,6 +2010,7 @@ def test_translation_query_shipping_method(
content = get_graphql_content(response, ignore_errors=True)
data = content["data"]["translation"]
assert data["name"] == shipping_method.name
+ assert data["description"] == shipping_method.description
assert data["translation"]["name"] == shipping_method_translation_fr.name
if return_shipping_method:
assert data["shippingMethod"]["name"] == shipping_method.name
diff --git a/saleor/graphql/translations/types.py b/saleor/graphql/translations/types.py
index 16b8786f04..2c4962c6c2 100644
--- a/saleor/graphql/translations/types.py
+++ b/saleor/graphql/translations/types.py
@@ -451,7 +451,7 @@ class ShippingMethodTranslatableContent(CountableDjangoObjectType):
class Meta:
model = shipping_models.ShippingMethod
interfaces = [graphene.relay.Node]
- only_fields = BASIC_TRANSLATABLE_FIELDS
+ only_fields = BASIC_TRANSLATABLE_FIELDS + ["description"]
@staticmethod
@permission_required(ShippingPermissions.MANAGE_SHIPPING)