Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Added missing description for Translation types. (#13410)
Smit Parmar21a5f1749dc5
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex c3fc44f1c1..f4219f4609 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -109,6 +109,7 @@ Shipping methods can be removed by the user after it has been assigned to a chec- Fix deleting event payloads by adding batches - #13368 by @jakubkuc- Add missing descriptions to Shipping module. - #13372 by @Smit-Parmar- Fix error handling in the permission check for `Query.webhook` - #13378 by @patrys+- Add missing descriptions to Translation module. - #13410 by @Smit-Parmar- Add missing descriptions to menu module - #13409 by @devilsautumn# 3.14.0diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex eed365b24a..ffd77e3d84 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -3945,11 +3945,14 @@ enum ShippingMethodTypeEnum @doc(category: "Shipping") {}type ShippingMethodTranslation implements Node @doc(category: "Shipping") {+ """The ID of the shipping method translation."""id: ID!"""Translation language."""language: LanguageDisplay!- name: String++ """Translated shipping method name."""+ name: String!"""Translated description of the shipping method.@@ -6199,20 +6202,23 @@ type AttributeValue implements Node @doc(category: "Attributes") {}type AttributeValueTranslation implements Node @doc(category: "Attributes") {+ """The ID of the attribute value translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated attribute value name."""name: String!"""- Attribute value.+ Translated rich-text attribute value.Rich text format. For reference see https://editorjs.io/"""richText: JSONString- """Attribute plain text value."""+ """Translated plain text attribute value ."""plainText: String}@@ -6253,10 +6259,13 @@ input AttributeValueFilterInput @doc(category: "Attributes") {}type AttributeTranslation implements Node @doc(category: "Attributes") {+ """The ID of the attribute translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated attribute name."""name: String!}@@ -6980,12 +6989,19 @@ enum ThumbnailFormatEnum {}type CategoryTranslation implements Node @doc(category: "Products") {+ """The ID of the category translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated SEO title."""seoTitle: String++ """Translated SEO description."""seoDescription: String++ """Translated category name."""name: String"""@@ -7436,10 +7452,13 @@ enum ProductMediaType @doc(category: "Products") {}type ProductVariantTranslation implements Node @doc(category: "Products") {+ """The ID of the product variant translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated product variant name."""name: String!}@@ -7846,12 +7865,19 @@ type Collection implements Node & ObjectWithMetadata @doc(category: "Products")}type CollectionTranslation implements Node @doc(category: "Products") {+ """The ID of the collection translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated SEO title."""seoTitle: String++ """Translated SEO description."""seoDescription: String++ """Translated collection name."""name: String"""@@ -7890,12 +7916,19 @@ type CollectionChannelListing implements Node @doc(category: "Products") {}type ProductTranslation implements Node @doc(category: "Products") {+ """The ID of the product translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated SEO title."""seoTitle: String++ """Translated SEO description."""seoDescription: String++ """Translated product name."""name: String"""@@ -7972,13 +8005,20 @@ type TranslatableItemEdge {union TranslatableItem = ProductTranslatableContent | CollectionTranslatableContent | CategoryTranslatableContent | AttributeTranslatableContent | AttributeValueTranslatableContent | ProductVariantTranslatableContent | PageTranslatableContent | ShippingMethodTranslatableContent | SaleTranslatableContent | VoucherTranslatableContent | MenuItemTranslatableContenttype ProductTranslatableContent implements Node @doc(category: "Products") {+ """The ID of the product translatable content."""id: ID!++ """SEO title to translate."""seoTitle: String++ """SEO description to translate."""seoDescription: String++ """Product's name to translate."""name: String!"""- Description of the product.+ Product's description to translate.Rich text format. For reference see https://editorjs.io/"""@@ -8005,7 +8045,10 @@ type ProductTranslatableContent implements Node @doc(category: "Products") {}type AttributeValueTranslatableContent implements Node @doc(category: "Attributes") {+ """The ID of the attribute value translatable content."""id: ID!++ """Name of the attribute value to translate."""name: String!"""@@ -8036,7 +8079,10 @@ type AttributeValueTranslatableContent implements Node @doc(category: "Attribute}type AttributeTranslatableContent implements Node @doc(category: "Attributes") {+ """The ID of the attribute."""id: ID!++ """Name of the attribute to translate."""name: String!"""Returns translated attribute fields for the given language code."""@@ -8050,13 +8096,20 @@ type AttributeTranslatableContent implements Node @doc(category: "Attributes") {}type CollectionTranslatableContent implements Node @doc(category: "Products") {+ """The ID of the collection translatable content."""id: ID!++ """SEO title to translate."""seoTitle: String++ """SEO description to translate."""seoDescription: String++ """Collection's name to translate."""name: String!"""- Description of the collection.+ Collection's description to translate.Rich text format. For reference see https://editorjs.io/"""@@ -8080,13 +8133,20 @@ type CollectionTranslatableContent implements Node @doc(category: "Products") {}type CategoryTranslatableContent implements Node @doc(category: "Products") {+ """The ID of the category translatable content."""id: ID!++ """SEO title to translate."""seoTitle: String++ """SEO description to translate."""seoDescription: String++ """Name of the category translatable content."""name: String!"""- Description of the category.+ Category description to translate.Rich text format. For reference see https://editorjs.io/"""@@ -8110,7 +8170,10 @@ type CategoryTranslatableContent implements Node @doc(category: "Products") {}type ProductVariantTranslatableContent implements Node @doc(category: "Products") {+ """The ID of the product variant translatable content."""id: ID!++ """Name of the product variant to translate."""name: String!"""Returns translated product variant fields for the given language code."""@@ -8127,13 +8190,20 @@ type ProductVariantTranslatableContent implements Node @doc(category: "Products"}type PageTranslatableContent implements Node @doc(category: "Pages") {+ """The ID of the page translatable content."""id: ID!++ """SEO title to translate."""seoTitle: String++ """SEO description to translate."""seoDescription: String++ """Page title to translate."""title: String!"""- Content of the page.+ Content of the page to translate.Rich text format. For reference see https://editorjs.io/"""@@ -8162,12 +8232,19 @@ type PageTranslatableContent implements Node @doc(category: "Pages") {}type PageTranslation implements Node @doc(category: "Pages") {+ """The ID of the page translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated SEO title."""seoTitle: String++ """Translated SEO description."""seoDescription: String++ """Translated page title."""title: String"""@@ -8352,11 +8429,14 @@ type PageType implements Node & ObjectWithMetadata @doc(category: "Pages") {}type ShippingMethodTranslatableContent implements Node @doc(category: "Shipping") {+ """The ID of the shipping method translatable content."""id: ID!++ """Shipping method name to translate."""name: String!"""- Description of the shipping method.+ Shipping method description to translate.Rich text format. For reference see https://editorjs.io/"""@@ -8377,7 +8457,10 @@ type ShippingMethodTranslatableContent implements Node @doc(category: "Shipping"}type SaleTranslatableContent implements Node @doc(category: "Discounts") {+ """The ID of the sale translatable content."""id: ID!++ """Name of the sale to translate."""name: String!"""Returns translated sale fields for the given language code."""@@ -8395,10 +8478,13 @@ type SaleTranslatableContent implements Node @doc(category: "Discounts") {}type SaleTranslation implements Node @doc(category: "Discounts") {+ """The ID of the sale translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated name of sale."""name: String}@@ -8631,7 +8717,10 @@ type SaleChannelListing implements Node @doc(category: "Discounts") {}type VoucherTranslatableContent implements Node @doc(category: "Discounts") {+ """The ID of the voucher translatable content."""id: ID!++ """Voucher name to translate."""name: String"""Returns translated voucher fields for the given language code."""@@ -8649,10 +8738,13 @@ type VoucherTranslatableContent implements Node @doc(category: "Discounts") {}type VoucherTranslation implements Node @doc(category: "Discounts") {+ """The ID of the voucher translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated voucher name."""name: String}@@ -8887,7 +8979,10 @@ type VoucherChannelListing implements Node @doc(category: "Discounts") {}type MenuItemTranslatableContent implements Node @doc(category: "Menu") {+ """The ID of the menu item translatable content."""id: ID!++ """Name of the menu item to translate."""name: String!"""Returns translated menu item fields for the given language code."""@@ -8903,10 +8998,13 @@ type MenuItemTranslatableContent implements Node @doc(category: "Menu") {}type MenuItemTranslation implements Node @doc(category: "Menu") {+ """The ID of the menu item translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated menu item name."""name: String!}@@ -9557,11 +9655,16 @@ type Domain {}type ShopTranslation implements Node @doc(category: "Shop") {+ """The ID of the shop translation."""id: ID!"""Translation language."""language: LanguageDisplay!++ """Translated header text of sale."""headerText: String!++ """Translated description of sale."""description: String!}diff --git a/saleor/graphql/translations/types.py b/saleor/graphql/translations/types.pyindex dd047ee4fb..8514f5d3e4 100644--- a/saleor/graphql/translations/types.py+++ b/saleor/graphql/translations/types.py@@ -73,10 +73,16 @@ class BaseTranslationType(ModelObjectType[T]):class AttributeValueTranslation(BaseTranslationType[attribute_models.AttributeValueTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)- rich_text = JSONString(description="Attribute value." + RICH_CONTENT)- plain_text = graphene.String(description="Attribute plain text value.")+ id = graphene.GlobalID(+ required=True, description="The ID of the attribute value translation."+ )+ name = graphene.String(+ required=True, description="Translated attribute value name."+ )+ rich_text = JSONString(+ description="Translated rich-text attribute value." + RICH_CONTENT+ )+ plain_text = graphene.String(description="Translated plain text attribute value .")class Meta:model = attribute_models.AttributeValueTranslation@@ -84,8 +90,10 @@ class AttributeValueTranslation(class AttributeTranslation(BaseTranslationType[attribute_models.AttributeTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the attribute translation."+ )+ name = graphene.String(required=True, description="Translated attribute name.")class Meta:model = attribute_models.AttributeTranslation@@ -93,8 +101,10 @@ class AttributeTranslation(BaseTranslationType[attribute_models.AttributeTranslaclass AttributeTranslatableContent(ModelObjectType[attribute_models.Attribute]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(required=True, description="The ID of the attribute.")+ name = graphene.String(+ required=True, description="Name of the attribute to translate."+ )translation = TranslationField(AttributeTranslation, type_name="attribute")attribute = graphene.Field("saleor.graphql.attribute.types.Attribute",@@ -116,8 +126,13 @@ class AttributeTranslatableContent(ModelObjectType[attribute_models.Attribute]):class AttributeValueTranslatableContent(ModelObjectType[attribute_models.AttributeValue]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the attribute value translatable content."+ )+ name = graphene.String(+ required=True,+ description="Name of the attribute value to translate.",+ )rich_text = JSONString(description="Attribute value." + RICH_CONTENT)plain_text = graphene.String(description="Attribute plain text value.")translation = TranslationField(@@ -151,8 +166,12 @@ class AttributeValueTranslatableContent(class ProductVariantTranslation(BaseTranslationType[product_models.ProductVariantTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the product variant translation."+ )+ name = graphene.String(+ required=True, description="Translated product variant name."+ )class Meta:model = product_models.ProductVariantTranslation@@ -160,8 +179,13 @@ class ProductVariantTranslation(class ProductVariantTranslatableContent(ModelObjectType[product_models.ProductVariant]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the product variant translatable content."+ )+ name = graphene.String(+ required=True,+ description="Name of the product variant to translate.",+ )translation = TranslationField(ProductVariantTranslation, type_name="product variant")@@ -198,10 +222,12 @@ class ProductVariantTranslatableContent(ModelObjectType[product_models.ProductVaclass ProductTranslation(BaseTranslationType[product_models.ProductTranslation]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the product translation."+ )+ seo_title = graphene.String(description="Translated SEO title.")+ seo_description = graphene.String(description="Translated SEO description.")+ name = graphene.String(description="Translated product name.")description = JSONString(description="Translated description of the product." + RICH_CONTENT)@@ -223,11 +249,15 @@ class ProductTranslation(BaseTranslationType[product_models.ProductTranslation])class ProductTranslatableContent(ModelObjectType[product_models.Product]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String(required=True)- description = JSONString(description="Description of the product." + RICH_CONTENT)+ id = graphene.GlobalID(+ required=True, description="The ID of the product translatable content."+ )+ seo_title = graphene.String(description="SEO title to translate.")+ seo_description = graphene.String(description="SEO description to translate.")+ name = graphene.String(required=True, description="Product's name to translate.")+ description = JSONString(+ description="Product's description to translate." + RICH_CONTENT+ )description_json = JSONString(description="Description of the product." + RICH_CONTENT,deprecation_reason=(@@ -271,10 +301,12 @@ class ProductTranslatableContent(ModelObjectType[product_models.Product]):class CollectionTranslation(BaseTranslationType[product_models.CollectionTranslation]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the collection translation."+ )+ seo_title = graphene.String(description="Translated SEO title.")+ seo_description = graphene.String(description="Translated SEO description.")+ name = graphene.String(description="Translated collection name.")description = JSONString(description="Translated description of the collection." + RICH_CONTENT)@@ -296,12 +328,14 @@ class CollectionTranslation(BaseTranslationType[product_models.CollectionTranslaclass CollectionTranslatableContent(ModelObjectType[product_models.Collection]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the collection translatable content."+ )+ seo_title = graphene.String(description="SEO title to translate.")+ seo_description = graphene.String(description="SEO description to translate.")+ name = graphene.String(required=True, description="Collection's name to translate.")description = JSONString(- description="Description of the collection." + RICH_CONTENT+ description="Collection's description to translate." + RICH_CONTENT)description_json = JSONString(description="Description of the collection." + RICH_CONTENT,@@ -336,10 +370,12 @@ class CollectionTranslatableContent(ModelObjectType[product_models.Collection]):class CategoryTranslation(BaseTranslationType[product_models.CategoryTranslation]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the category translation."+ )+ seo_title = graphene.String(description="Translated SEO title.")+ seo_description = graphene.String(description="Translated SEO description.")+ name = graphene.String(description="Translated category name.")description = JSONString(description="Translated description of the category." + RICH_CONTENT)@@ -361,11 +397,17 @@ class CategoryTranslation(BaseTranslationType[product_models.CategoryTranslationclass CategoryTranslatableContent(ModelObjectType[product_models.Category]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- name = graphene.String(required=True)- description = JSONString(description="Description of the category." + RICH_CONTENT)+ id = graphene.GlobalID(+ required=True, description="The ID of the category translatable content."+ )+ seo_title = graphene.String(description="SEO title to translate.")+ seo_description = graphene.String(description="SEO description to translate.")+ name = graphene.String(+ required=True, description="Name of the category translatable content."+ )+ description = JSONString(+ description="Category description to translate." + RICH_CONTENT+ )description_json = JSONString(description="Description of the category." + RICH_CONTENT,deprecation_reason=(@@ -396,10 +438,10 @@ class CategoryTranslatableContent(ModelObjectType[product_models.Category]):class PageTranslation(BaseTranslationType[page_models.PageTranslation]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- title = graphene.String()+ id = graphene.GlobalID(required=True, description="The ID of the page translation.")+ seo_title = graphene.String(description="Translated SEO title.")+ seo_description = graphene.String(description="Translated SEO description.")+ title = graphene.String(description="Translated page title.")content = JSONString(description="Translated content of the page." + RICH_CONTENT)content_json = JSONString(description="Translated description of the page." + RICH_CONTENT,@@ -417,11 +459,13 @@ class PageTranslation(BaseTranslationType[page_models.PageTranslation]):class PageTranslatableContent(ModelObjectType[page_models.Page]):- id = graphene.GlobalID(required=True)- seo_title = graphene.String()- seo_description = graphene.String()- title = graphene.String(required=True)- content = JSONString(description="Content of the page." + RICH_CONTENT)+ id = graphene.GlobalID(+ required=True, description="The ID of the page translatable content."+ )+ seo_title = graphene.String(description="SEO title to translate.")+ seo_description = graphene.String(description="SEO description to translate.")+ title = graphene.String(required=True, description="Page title to translate.")+ content = JSONString(description="Content of the page to translate." + RICH_CONTENT)content_json = JSONString(description="Content of the page." + RICH_CONTENT,deprecation_reason=f"{DEPRECATED_IN_3X_FIELD} Use the `content` field instead.",@@ -470,8 +514,10 @@ class PageTranslatableContent(ModelObjectType[page_models.Page]):class VoucherTranslation(BaseTranslationType[discount_models.VoucherTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the voucher translation."+ )+ name = graphene.String(description="Translated voucher name.")class Meta:model = discount_models.VoucherTranslation@@ -479,8 +525,10 @@ class VoucherTranslation(BaseTranslationType[discount_models.VoucherTranslation]class VoucherTranslatableContent(ModelObjectType[discount_models.Voucher]):- id = graphene.GlobalID(required=True)- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the voucher translatable content."+ )+ name = graphene.String(description="Voucher name to translate.")translation = TranslationField(VoucherTranslation, type_name="voucher")voucher = PermissionsField("saleor.graphql.discount.types.Voucher",@@ -505,8 +553,8 @@ class VoucherTranslatableContent(ModelObjectType[discount_models.Voucher]):class SaleTranslation(BaseTranslationType[discount_models.SaleTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String()+ id = graphene.GlobalID(required=True, description="The ID of the sale translation.")+ name = graphene.String(description="Translated name of sale.")class Meta:model = discount_models.SaleTranslation@@ -514,8 +562,10 @@ class SaleTranslation(BaseTranslationType[discount_models.SaleTranslation]):class SaleTranslatableContent(ModelObjectType[discount_models.Sale]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the sale translatable content."+ )+ name = graphene.String(required=True, description="Name of the sale to translate.")translation = TranslationField(SaleTranslation, type_name="sale")sale = PermissionsField("saleor.graphql.discount.types.Sale",@@ -539,9 +589,13 @@ class SaleTranslatableContent(ModelObjectType[discount_models.Sale]):class ShopTranslation(BaseTranslationType[site_models.SiteSettingsTranslation]):- id = graphene.GlobalID(required=True)- header_text = graphene.String(required=True)- description = graphene.String(required=True)+ id = graphene.GlobalID(required=True, description="The ID of the shop translation.")+ header_text = graphene.String(+ required=True, description="Translated header text of sale."+ )+ description = graphene.String(+ required=True, description="Translated description of sale."+ )class Meta:model = site_models.SiteSettingsTranslation@@ -549,8 +603,10 @@ class ShopTranslation(BaseTranslationType[site_models.SiteSettingsTranslation]):class MenuItemTranslation(BaseTranslationType[menu_models.MenuItemTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the menu item translation."+ )+ name = graphene.String(required=True, description="Translated menu item name.")class Meta:model = menu_models.MenuItemTranslation@@ -558,8 +614,12 @@ class MenuItemTranslation(BaseTranslationType[menu_models.MenuItemTranslation]):class MenuItemTranslatableContent(ModelObjectType[menu_models.MenuItem]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the menu item translatable content."+ )+ name = graphene.String(+ required=True, description="Name of the menu item to translate."+ )translation = TranslationField(MenuItemTranslation, type_name="menu item")menu_item = graphene.Field("saleor.graphql.menu.types.MenuItem",@@ -584,8 +644,12 @@ class MenuItemTranslatableContent(ModelObjectType[menu_models.MenuItem]):class ShippingMethodTranslation(BaseTranslationType[shipping_models.ShippingMethodTranslation]):- id = graphene.GlobalID(required=True)- name = graphene.String()+ id = graphene.GlobalID(+ required=True, description="The ID of the shipping method translation."+ )+ name = graphene.String(+ required=True, description="Translated shipping method name."+ )description = JSONString(description="Translated description of the shipping method." + RICH_CONTENT)@@ -598,10 +662,14 @@ class ShippingMethodTranslation(class ShippingMethodTranslatableContent(ModelObjectType[shipping_models.ShippingMethod]):- id = graphene.GlobalID(required=True)- name = graphene.String(required=True)+ id = graphene.GlobalID(+ required=True, description="The ID of the shipping method translatable content."+ )+ name = graphene.String(+ required=True, description="Shipping method name to translate."+ )description = JSONString(- description="Description of the shipping method." + RICH_CONTENT+ description="Shipping method description to translate." + RICH_CONTENT)translation = TranslationField(ShippingMethodTranslation, type_name="shipping method"