Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add message about fields added in 3.1
Marcin Gębala497cb116d359
diff --git a/saleor/graphql/app/schema.py b/saleor/graphql/app/schema.pyindex 4baa660ecf..2cc75bddbb 100644--- a/saleor/graphql/app/schema.py+++ b/saleor/graphql/app/schema.py@@ -1,6 +1,7 @@import graphenefrom ...core.permissions import AppPermission+from ..core.descriptions import ADDED_IN_31from ..core.fields import FilterInputConnectionFieldfrom ..core.types import FilterInputObjectTypefrom ..core.utils import from_global_id_or_error@@ -67,14 +68,14 @@ class AppQueries(graphene.ObjectType):filter=AppExtensionFilterInput(description="Filtering options for apps extensions."),- description="List of all extensions",+ description=f"{ADDED_IN_31} List of all extensions",)app_extension = graphene.Field(AppExtension,id=graphene.Argument(graphene.ID, description="ID of the app extension.", required=True),- description="Look up an app extension by ID.",+ description=f"{ADDED_IN_31} Look up an app extension by ID.",)@permission_required(AppPermission.MANAGE_APPS)diff --git a/saleor/graphql/app/types.py b/saleor/graphql/app/types.pyindex 2e0c944260..58da71c111 100644--- a/saleor/graphql/app/types.py+++ b/saleor/graphql/app/types.py@@ -5,6 +5,7 @@ from ...app import modelsfrom ...core.exceptions import PermissionDeniedfrom ...core.permissions import AppPermissionfrom ..core.connection import CountableDjangoObjectType+from ..core.descriptions import ADDED_IN_31from ..core.types import Permissionfrom ..core.types.common import Jobfrom ..meta.types import ObjectWithMetadata@@ -159,7 +160,7 @@ class App(CountableDjangoObjectType):)extensions = graphene.List(graphene.NonNull(AppExtension),- description="App's dashboard extensions.",+ description=f"{ADDED_IN_31} App's dashboard extensions.",required=True,)diff --git a/saleor/graphql/channel/mutations.py b/saleor/graphql/channel/mutations.pyindex 3db23f9d14..3d9c880f58 100644--- a/saleor/graphql/channel/mutations.py+++ b/saleor/graphql/channel/mutations.py@@ -12,6 +12,7 @@ from ...core.tracing import traced_atomic_transactionfrom ...order.models import Orderfrom ...shipping.tasks import drop_invalid_shipping_methods_relations_for_given_channelsfrom ..account.enums import CountryCodeEnum+from ..core.descriptions import ADDED_IN_31from ..core.mutations import BaseMutation, ModelDeleteMutation, ModelMutationfrom ..core.types.common import ChannelError, ChannelErrorCodefrom ..core.utils import get_duplicated_values, get_duplicates_ids@@ -31,9 +32,9 @@ class ChannelCreateInput(ChannelInput):)default_country = CountryCodeEnum(description=(- "Default country for the channel. Default country can be used in checkout "- "to determine the stock quantities or calculate taxes when the country was "- "not explicitly provided."+ f"{ADDED_IN_31} Default country for the channel. Default country can be "+ "used in checkout to determine the stock quantities or calculate taxes "+ "when the country was not explicitly provided."),required=True,)@@ -84,9 +85,9 @@ class ChannelUpdateInput(ChannelInput):slug = graphene.String(description="Slug of the channel.")default_country = CountryCodeEnum(description=(- "Default country for the channel. Default country can be used in checkout "- "to determine the stock quantities or calculate taxes when the country was "- "not explicitly provided."+ f"{ADDED_IN_31} Default country for the channel. Default country can be "+ "used in checkout to determine the stock quantities or calculate taxes "+ "when the country was not explicitly provided."))add_shipping_zones = graphene.List(diff --git a/saleor/graphql/channel/types.py b/saleor/graphql/channel/types.pyindex 7662177df0..27fa7b5829 100644--- a/saleor/graphql/channel/types.py+++ b/saleor/graphql/channel/types.py@@ -5,6 +5,7 @@ from graphene_django import DjangoObjectTypefrom ...channel import modelsfrom ...core.permissions import ChannelPermissionsfrom ..core.connection import CountableDjangoObjectType+from ..core.descriptions import ADDED_IN_31from ..core.types import CountryDisplayfrom ..decorators import permission_requiredfrom ..meta.types import ObjectWithMetadata@@ -68,9 +69,9 @@ class Channel(CountableDjangoObjectType):default_country = graphene.Field(CountryDisplay,description=(- "Default country for the channel. Default country can be used in checkout "- "to determine the stock quantities or calculate taxes when the country was "- "not explicitly provided."+ f"{ADDED_IN_31} Default country for the channel. Default country can be "+ "used in checkout to determine the stock quantities or calculate taxes "+ "when the country was not explicitly provided."),required=True,)diff --git a/saleor/graphql/core/descriptions.py b/saleor/graphql/core/descriptions.pyindex 0f29c24f11..7c5b66162e 100644--- a/saleor/graphql/core/descriptions.py+++ b/saleor/graphql/core/descriptions.py@@ -5,3 +5,6 @@ DEPRECATED_IN_3X_FIELD = "This field will be removed in Saleor 4.0."# Deprecation message for input fields and query arguments. Use it, when# deprecation message needs to be included in the field description.DEPRECATED_IN_3X_INPUT = "\n\nDEPRECATED: this field will be removed in Saleor 4.0."+++ADDED_IN_31 = "New in Saleor 3.1."diff --git a/saleor/graphql/giftcard/mutations.py b/saleor/graphql/giftcard/mutations.pyindex 1647525831..26823d187f 100644--- a/saleor/graphql/giftcard/mutations.py+++ b/saleor/graphql/giftcard/mutations.py@@ -9,7 +9,7 @@ from ...core.utils.validators import date_passed, user_is_validfrom ...giftcard import GiftCardExpiryType, events, modelsfrom ...giftcard.error_codes import GiftCardErrorCodefrom ...giftcard.utils import activate_gift_card, deactivate_gift_card-from ..core.descriptions import DEPRECATED_IN_3X_INPUT+from ..core.descriptions import ADDED_IN_31, DEPRECATED_IN_3X_INPUTfrom ..core.mutations import BaseMutation, ModelDeleteMutation, ModelMutationfrom ..core.scalars import PositiveDecimalfrom ..core.types.common import GiftCardError, PriceInput, TimePeriodInputType@@ -27,7 +27,7 @@ class GiftCardExpirySettingsInput(graphene.InputObjectType):class GiftCardInput(graphene.InputObjectType):- tag = graphene.String(description="The gift card tag.")+ tag = graphene.String(description=f"{ADDED_IN_31} The gift card tag.")# DEPRECATEDstart_date = graphene.types.datetime.Date(@@ -52,7 +52,7 @@ class GiftCardCreateInput(GiftCardInput):description="Email of the customer to whom gift card will be sent.",)expiry_settings = GiftCardExpirySettingsInput(- description="The gift card expiry settings.", required=True+ description=f"{ADDED_IN_31} The gift card expiry settings.", required=True)code = graphene.String(required=False,@@ -66,10 +66,10 @@ class GiftCardCreateInput(GiftCardInput):class GiftCardUpdateInput(GiftCardInput):balance_amount = PositiveDecimal(- description="The gift card balance amount.", required=False+ description=f"{ADDED_IN_31} The gift card balance amount.", required=False)expiry_settings = GiftCardExpirySettingsInput(- description="The gift card expiry settings.", required=False+ description=f"{ADDED_IN_31} The gift card expiry settings.", required=False)@@ -247,7 +247,7 @@ class GiftCardDelete(ModelDeleteMutation):id = graphene.ID(description="ID of the gift card to delete.", required=True)class Meta:- description = "Delete gift card."+ description = f"{ADDED_IN_31} Delete gift card."model = models.GiftCardpermissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)error_type_class = GiftCardErrordiff --git a/saleor/graphql/giftcard/schema.py b/saleor/graphql/giftcard/schema.pyindex 4f376fbe46..2839f9fc5e 100644--- a/saleor/graphql/giftcard/schema.py+++ b/saleor/graphql/giftcard/schema.py@@ -1,6 +1,7 @@import graphenefrom ...core.permissions import GiftcardPermissions+from ..core.descriptions import ADDED_IN_31from ..core.fields import FilterInputConnectionFieldfrom ..core.utils import from_global_id_or_errorfrom ..decorators import permission_required@@ -26,7 +27,9 @@ class GiftCardQueries(graphene.ObjectType):)gift_cards = FilterInputConnectionField(GiftCard,- filter=GiftCardFilterInput(description="Filtering options for gift cards."),+ filter=GiftCardFilterInput(+ description=f"{ADDED_IN_31} Filtering options for gift cards."+ ),description="List of gift cards.",)diff --git a/saleor/graphql/giftcard/types.py b/saleor/graphql/giftcard/types.pyindex 6ba2b88459..d474855aa7 100644--- a/saleor/graphql/giftcard/types.py+++ b/saleor/graphql/giftcard/types.py@@ -15,7 +15,7 @@ from ..account.utils import requestor_has_accessfrom ..app.dataloaders import AppByIdLoaderfrom ..app.types import Appfrom ..core.connection import CountableDjangoObjectType-from ..core.descriptions import DEPRECATED_IN_3X_FIELD+from ..core.descriptions import ADDED_IN_31, DEPRECATED_IN_3X_FIELDfrom ..core.types.common import TimePeriodfrom ..core.types.money import Moneyfrom ..decorators import permission_required@@ -219,39 +219,49 @@ class GiftCard(CountableDjangoObjectType):)created_by = graphene.Field("saleor.graphql.account.types.User",- description="The user who bought or issued a gift card.",+ description=f"{ADDED_IN_31} The user who bought or issued a gift card.",)used_by = graphene.Field("saleor.graphql.account.types.User",- description="The customer who used a gift card.",+ description=f"{ADDED_IN_31} The customer who used a gift card.",)created_by_email = graphene.String(required=False,- description="Email address of the user who bought or issued gift card.",+ description=(+ f"{ADDED_IN_31} Email address of the user who bought or issued gift card."+ ),)used_by_email = graphene.String(required=False,- description="Email address of the customer who used a gift card.",+ description=(+ f"{ADDED_IN_31} Email address of the customer who used a gift card."+ ),)app = graphene.Field(App,- description="App which created the gift card.",+ description=f"{ADDED_IN_31} App which created the gift card.",)expiry_type = GiftCardExpiryTypeEnum(- description="The gift card expiry type.", required=True+ description=f"{ADDED_IN_31} The gift card expiry type.", required=True)expiry_period = graphene.Field(- TimePeriod, description="The gift card expiry period.", required=False+ TimePeriod,+ description=f"{ADDED_IN_31} The gift card expiry period.",+ required=False,+ )+ expiry_date = graphene.types.datetime.Date(+ description=f"{ADDED_IN_31} The gift card expiry date.")product = graphene.Field("saleor.graphql.product.types.products.Product",- description="Related gift card product.",+ description=f"{ADDED_IN_31} Related gift card product.",)events = graphene.List(graphene.NonNull(GiftCardEvent),- description="List of events associated with the gift card.",+ description=f"{ADDED_IN_31} List of events associated with the gift card.",required=True,)+ tag = graphene.String(description=f"{ADDED_IN_31} The gift card tag.")# DEPRECATEDuser = graphene.Field(diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.pyindex 9e060341a0..2490db10e9 100644--- a/saleor/graphql/order/mutations/fulfillments.py+++ b/saleor/graphql/order/mutations/fulfillments.py@@ -18,6 +18,7 @@ from ....order.actions import ()from ....order.error_codes import OrderErrorCodefrom ....order.notifications import send_fulfillment_update+from ...core.descriptions import ADDED_IN_31from ...core.mutations import BaseMutationfrom ...core.scalars import PositiveDecimalfrom ...core.types.common import OrderError@@ -366,7 +367,7 @@ class FulfillmentApprove(BaseMutation):)class Meta:- description = "Approve existing fulfillment."+ description = f"{ADDED_IN_31} Approve existing fulfillment."permissions = (OrderPermissions.MANAGE_ORDERS,)error_type_class = OrderErrorerror_type_field = "order_errors"diff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex 7110fb2a15..a3aaf9b0d9 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -43,7 +43,7 @@ from ..app.types import Appfrom ..channel import ChannelContextfrom ..channel.dataloaders import ChannelByIdLoader, ChannelByOrderLineIdLoaderfrom ..core.connection import CountableDjangoObjectType-from ..core.descriptions import DEPRECATED_IN_3X_FIELD+from ..core.descriptions import ADDED_IN_31, DEPRECATED_IN_3X_FIELDfrom ..core.enums import LanguageCodeEnumfrom ..core.mutations import validation_error_to_error_typefrom ..core.scalars import PositiveDecimal@@ -443,7 +443,8 @@ class OrderLine(CountableDjangoObjectType):description="List of allocations across warehouses.",)quantity_to_fulfill = graphene.Int(- required=True, description="A quantity of items remaining to be fulfilled."+ required=True,+ description=f"{ADDED_IN_31} A quantity of items remaining to be fulfilled.",)unit_discount_type = graphene.Field(DiscountValueTypeEnum,diff --git a/saleor/graphql/shop/mutations.py b/saleor/graphql/shop/mutations.pyindex 152b742d08..b0f38fe12e 100644--- a/saleor/graphql/shop/mutations.py+++ b/saleor/graphql/shop/mutations.py@@ -7,6 +7,7 @@ from ...core.permissions import OrderPermissions, SitePermissionsfrom ...core.utils.url import validate_storefront_urlfrom ..account.i18n import I18nMixinfrom ..account.types import AddressInput+from ..core.descriptions import ADDED_IN_31from ..core.enums import WeightUnitsEnumfrom ..core.mutations import BaseMutation, ModelDeleteMutation, ModelMutationfrom ..core.types.common import OrderSettingsError, ShopError@@ -29,10 +30,12 @@ class ShopSettingsInput(graphene.InputObjectType):description="Enable automatic fulfillment for all digital products.")fulfillment_auto_approve = graphene.Boolean(- description="Enable automatic approval of all new fulfillments."+ description=f"{ADDED_IN_31} Enable automatic approval of all new fulfillments.")fulfillment_allow_unpaid = graphene.Boolean(- description="Enable ability to approve fulfillments which are unpaid."+ description=(+ f"{ADDED_IN_31} Enable ability to approve fulfillments which are unpaid."+ ))default_digital_max_downloads = graphene.Int(description="Default number of max downloads per digital content URL."diff --git a/saleor/graphql/shop/types.py b/saleor/graphql/shop/types.pyindex c311b4ae3a..6a10f0269b 100644--- a/saleor/graphql/shop/types.py+++ b/saleor/graphql/shop/types.py@@ -16,7 +16,7 @@ from ...site import models as site_modelsfrom ..account.types import Address, AddressInput, StaffNotificationRecipientfrom ..checkout.types import PaymentGatewayfrom ..core.connection import CountableDjangoObjectType-from ..core.descriptions import DEPRECATED_IN_3X_INPUT+from ..core.descriptions import ADDED_IN_31, DEPRECATED_IN_3X_INPUTfrom ..core.enums import LanguageCodeEnum, WeightUnitsEnumfrom ..core.types.common import CountryDisplay, LanguageDisplay, Permissionfrom ..core.utils import str_to_enum@@ -122,7 +122,9 @@ class Shop(graphene.ObjectType):)channel_currencies = graphene.List(graphene.NonNull(graphene.String),- description="List of all currencies supported by shop's channels.",+ description=(+ f"{ADDED_IN_31} List of all currencies supported by shop's channels."+ ),required=True,)countries = graphene.List(@@ -165,10 +167,12 @@ class Shop(graphene.ObjectType):description="Include taxes in prices.", required=True)fulfillment_auto_approve = graphene.Boolean(- description="Automatically approve all new fulfillments.", required=True+ description=f"{ADDED_IN_31} Automatically approve all new fulfillments.",+ required=True,)fulfillment_allow_unpaid = graphene.Boolean(- description="Allow to approve fulfillments which are unpaid.", required=True+ description=f"{ADDED_IN_31} Allow to approve fulfillments which are unpaid.",+ required=True,)display_gross_prices = graphene.Boolean(description="Display prices with tax in store.", required=True