Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add webhook definitions for part of the schema (#13183)
Maciej Korycinskiac5667964a83
diff --git a/saleor/graphql/account/bulk_mutations/customer_bulk_delete.py b/saleor/graphql/account/bulk_mutations/customer_bulk_delete.pyindex 58d7c1bb14..4c637ba806 100644--- a/saleor/graphql/account/bulk_mutations/customer_bulk_delete.py+++ b/saleor/graphql/account/bulk_mutations/customer_bulk_delete.py@@ -2,10 +2,12 @@ import graphenefrom ....account import modelsfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_USERSfrom ...core.mutations import ModelBulkDeleteMutationfrom ...core.types import AccountError, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..mutations.base import CustomerDeleteMixinfrom ..types import User@@ -30,6 +32,12 @@ class CustomerBulkDelete(CustomerDeleteMixin, UserBulkDelete):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_DELETED,+ description="A customer account was deleted.",+ )+ ]@classmethoddef perform_mutation(cls, root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/account/bulk_mutations/customer_bulk_update.py b/saleor/graphql/account/bulk_mutations/customer_bulk_update.pyindex f883a4ee3d..7ad7a7463a 100644--- a/saleor/graphql/account/bulk_mutations/customer_bulk_update.py+++ b/saleor/graphql/account/bulk_mutations/customer_bulk_update.py@@ -15,6 +15,7 @@ from ....core.tracing import traced_atomic_transactionfrom ....giftcard.utils import assign_user_gift_cardsfrom ....order.utils import match_orders_with_new_userfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core.descriptions import ADDED_IN_313, PREVIEW_FEATUREfrom ...core.doc_category import DOC_CATEGORY_USERSfrom ...core.enums import CustomerBulkUpdateErrorCode, ErrorPolicyEnum@@ -25,7 +26,7 @@ from ...core.types import (CustomerBulkUpdateError,NonNullList,)-from ...core.utils import get_duplicated_values+from ...core.utils import WebhookEventInfo, get_duplicated_valuesfrom ...core.validators import validate_one_of_args_is_in_mutationfrom ...payment.utils import metadata_contains_empty_keyfrom ...plugins.dataloaders import get_app_promise, get_plugin_manager_promise@@ -96,6 +97,16 @@ class CustomerBulkUpdate(BaseMutation, I18nMixin):doc_category = DOC_CATEGORY_USERSpermissions = (AccountPermissions.MANAGE_USERS,)error_type_class = CustomerBulkUpdateError+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer account was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_METADATA_UPDATED,+ description="Optionally called when customer's metadata was updated.",+ ),+ ]@classmethoddef format_errors(cls, index, errors, index_error_map, field_prefix=None):diff --git a/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py b/saleor/graphql/account/bulk_mutations/staff_bulk_delete.pyindex cb236c354a..94a27195ce 100644--- a/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py+++ b/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py@@ -5,9 +5,11 @@ from django.core.exceptions import ValidationErrorfrom ....account import modelsfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_USERSfrom ...core.types import StaffError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..mutations.base import StaffDeleteMixinfrom ..types import User@@ -25,6 +27,12 @@ class StaffBulkDelete(StaffDeleteMixin, UserBulkDelete):permissions = (AccountPermissions.MANAGE_STAFF,)error_type_class = StaffErrorerror_type_field = "staff_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.STAFF_DELETED,+ description="A staff account was deleted.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/account/account_address_create.py b/saleor/graphql/account/mutations/account/account_address_create.pyindex e5d4f90c0c..57ea86ccb1 100644--- a/saleor/graphql/account/mutations/account/account_address_create.py+++ b/saleor/graphql/account/mutations/account/account_address_create.py@@ -8,10 +8,12 @@ from .....account.utils import ()from .....core.tracing import traced_atomic_transactionfrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import ModelMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...enums import AddressTypeEnumfrom ...i18n import I18nMixin@@ -44,6 +46,16 @@ class AccountAddressCreate(ModelMutation, I18nMixin):error_type_class = AccountErrorerror_type_field = "account_errors"permissions = (AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer account was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_CREATED,+ description="An address was created.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/account/account_address_delete.py b/saleor/graphql/account/mutations/account/account_address_delete.pyindex c2657f8788..8a3b1975b6 100644--- a/saleor/graphql/account/mutations/account/account_address_delete.py+++ b/saleor/graphql/account/mutations/account/account_address_delete.py@@ -1,6 +1,8 @@from .....account import models+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ...types import Addressfrom ..base import BaseAddressDelete@@ -17,3 +19,9 @@ class AccountAddressDelete(BaseAddressDelete):object_type = Addresserror_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_DELETED,+ description="An address was deleted.",+ )+ ]diff --git a/saleor/graphql/account/mutations/account/account_address_update.py b/saleor/graphql/account/mutations/account/account_address_update.pyindex e0ec6e3d1a..11783bc798 100644--- a/saleor/graphql/account/mutations/account/account_address_update.py+++ b/saleor/graphql/account/mutations/account/account_address_update.py@@ -1,6 +1,8 @@from .....account import models+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ...types import Addressfrom ..base import BaseAddressUpdate@@ -17,3 +19,9 @@ class AccountAddressUpdate(BaseAddressUpdate):error_type_field = "account_errors"model = models.Addressobject_type = Address+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_UPDATED,+ description="An address was updated.",+ )+ ]diff --git a/saleor/graphql/account/mutations/account/account_register.py b/saleor/graphql/account/mutations/account/account_register.pyindex 9cb060b240..534689222d 100644--- a/saleor/graphql/account/mutations/account/account_register.py+++ b/saleor/graphql/account/mutations/account/account_register.py@@ -11,12 +11,14 @@ from .....account import models, notifications, searchfrom .....account.error_codes import AccountErrorCodefrom .....core.tracing import traced_atomic_transactionfrom .....core.utils.url import prepare_url, validate_storefront_url+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel.utils import clean_channelfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.enums import LanguageCodeEnumfrom ....core.mutations import ModelMutationfrom ....core.types import AccountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....meta.inputs import MetadataInputfrom ....plugins.dataloaders import get_plugin_manager_promisefrom ....site.dataloaders import get_site_promise@@ -74,6 +76,16 @@ class AccountRegister(ModelMutation):error_type_class = AccountErrorerror_type_field = "account_errors"support_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_CREATED,+ description="A new customer account was created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for account confirmation.",+ ),+ ]@classmethoddef mutate(cls, root, info: ResolveInfo, **data):diff --git a/saleor/graphql/account/mutations/account/account_request_deletion.py b/saleor/graphql/account/mutations/account/account_request_deletion.pyindex e561e42dab..810320472e 100644--- a/saleor/graphql/account/mutations/account/account_request_deletion.py+++ b/saleor/graphql/account/mutations/account/account_request_deletion.py@@ -8,11 +8,13 @@ from .....account.error_codes import AccountErrorCodefrom .....core.tokens import account_delete_token_generatorfrom .....core.utils.url import prepare_url, validate_storefront_urlfrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel.utils import clean_channelfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promise@@ -40,6 +42,12 @@ class AccountRequestDeletion(BaseMutation):permissions = (AuthorizationFilters.AUTHENTICATED_USER,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for account delete request.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/account/account_set_default_address.py b/saleor/graphql/account/mutations/account/account_set_default_address.pyindex 9ce5bd5e69..8d513843b0 100644--- a/saleor/graphql/account/mutations/account/account_set_default_address.py+++ b/saleor/graphql/account/mutations/account/account_set_default_address.py@@ -7,10 +7,12 @@ from .....account import models, utilsfrom .....account.error_codes import AccountErrorCodefrom .....checkout import AddressTypefrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...enums import AddressTypeEnumfrom ...types import Address, User@@ -31,6 +33,12 @@ class AccountSetDefaultAddress(BaseMutation):error_type_class = AccountErrorerror_type_field = "account_errors"permissions = (AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer's address was updated.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/account/account_update.py b/saleor/graphql/account/mutations/account/account_update.pyindex 35982fb5ab..a62cdb53bb 100644--- a/saleor/graphql/account/mutations/account/account_update.py+++ b/saleor/graphql/account/mutations/account/account_update.py@@ -4,10 +4,12 @@ import graphenefrom .....account import modelsfrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.descriptions import ADDED_IN_314from ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....meta.inputs import MetadataInputfrom ...types import AddressInput, Userfrom ..base import BaseCustomerCreate@@ -49,6 +51,16 @@ class AccountUpdate(BaseCustomerCreate):error_type_class = AccountErrorerror_type_field = "account_errors"support_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer account was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_METADATA_UPDATED,+ description="Optionally called when customer's metadata was updated.",+ ),+ ]@classmethoddef perform_mutation(cls, root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/account/mutations/account/confirm_email_change.py b/saleor/graphql/account/mutations/account/confirm_email_change.pyindex 09f882880b..ebea27c818 100644--- a/saleor/graphql/account/mutations/account/confirm_email_change.py+++ b/saleor/graphql/account/mutations/account/confirm_email_change.py@@ -10,11 +10,13 @@ from .....core.jwt import jwt_decodefrom .....giftcard.utils import assign_user_gift_cardsfrom .....order.utils import match_orders_with_new_userfrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel.utils import clean_channelfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import User@@ -39,6 +41,16 @@ class ConfirmEmailChange(BaseMutation):error_type_class = AccountErrorerror_type_field = "account_errors"permissions = (AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer account was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification that account email change was confirmed.",+ ),+ ]@classmethoddef get_token_payload(cls, token):diff --git a/saleor/graphql/account/mutations/account/request_email_change.py b/saleor/graphql/account/mutations/account/request_email_change.pyindex 9858f0b900..905a5f8095 100644--- a/saleor/graphql/account/mutations/account/request_email_change.py+++ b/saleor/graphql/account/mutations/account/request_email_change.py@@ -9,11 +9,13 @@ from .....account.error_codes import AccountErrorCodefrom .....core.jwt import create_tokenfrom .....core.utils.url import validate_storefront_urlfrom .....permission.auth_filters import AuthorizationFilters+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel.utils import clean_channelfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import User@@ -44,6 +46,12 @@ class RequestEmailChange(BaseMutation):error_type_class = AccountErrorerror_type_field = "account_errors"permissions = (AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for account email change.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/authentication/request_password_reset.py b/saleor/graphql/account/mutations/authentication/request_password_reset.pyindex fa640f2760..ca33988175 100644--- a/saleor/graphql/account/mutations/authentication/request_password_reset.py+++ b/saleor/graphql/account/mutations/authentication/request_password_reset.py@@ -7,11 +7,13 @@ from .....account.error_codes import AccountErrorCodefrom .....account.notifications import send_password_reset_notificationfrom .....account.utils import retrieve_user_by_emailfrom .....core.utils.url import validate_storefront_url+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel.utils import clean_channel, validate_channelfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promise@@ -40,6 +42,12 @@ class RequestPasswordReset(BaseMutation):doc_category = DOC_CATEGORY_USERSerror_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for password reset.",+ )+ ]@classmethoddef clean_user(cls, email, redirect_url):diff --git a/saleor/graphql/account/mutations/permission_group/permission_group_create.py b/saleor/graphql/account/mutations/permission_group/permission_group_create.pyindex 4f024ef710..00b4b6351f 100644--- a/saleor/graphql/account/mutations/permission_group/permission_group_create.py+++ b/saleor/graphql/account/mutations/permission_group/permission_group_create.py@@ -11,6 +11,7 @@ from .....channel.models import Channelfrom .....core.exceptions import PermissionDeniedfrom .....core.tracing import traced_atomic_transactionfrom .....permission.enums import AccountPermissions, get_permissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.utils import get_out_of_scope_permissions, get_user_accessible_channelsfrom ....app.dataloaders import get_app_promisefrom ....core import ResolveInfo@@ -19,6 +20,7 @@ from ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.enums import PermissionEnumfrom ....core.mutations import ModelMutationfrom ....core.types import BaseInputObjectType, NonNullList, PermissionGroupError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Group@@ -78,6 +80,11 @@ class PermissionGroupCreate(ModelMutation):permissions = (AccountPermissions.MANAGE_STAFF,)error_type_class = PermissionGroupErrorerror_type_field = "permission_group_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.PERMISSION_GROUP_CREATED,+ )+ ]@classmethoddef _save_m2m(cls, info: ResolveInfo, instance, cleaned_data):diff --git a/saleor/graphql/account/mutations/permission_group/permission_group_delete.py b/saleor/graphql/account/mutations/permission_group/permission_group_delete.pyindex 67c4ea2fb6..31da316726 100644--- a/saleor/graphql/account/mutations/permission_group/permission_group_delete.py+++ b/saleor/graphql/account/mutations/permission_group/permission_group_delete.py@@ -5,6 +5,7 @@ from .....account import modelsfrom .....account.error_codes import PermissionGroupErrorCodefrom .....core.exceptions import PermissionDeniedfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.utils import (can_user_manage_group_channels,can_user_manage_group_permissions,@@ -16,6 +17,7 @@ from ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.enums import PermissionEnumfrom ....core.mutations import ModelDeleteMutationfrom ....core.types import PermissionGroupError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Group@@ -34,6 +36,11 @@ class PermissionGroupDelete(ModelDeleteMutation):permissions = (AccountPermissions.MANAGE_STAFF,)error_type_class = PermissionGroupErrorerror_type_field = "permission_group_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.PERMISSION_GROUP_DELETED,+ )+ ]@classmethoddef post_save_action(cls, info: ResolveInfo, instance, cleaned_input):diff --git a/saleor/graphql/account/mutations/permission_group/permission_group_update.py b/saleor/graphql/account/mutations/permission_group/permission_group_update.pyindex 3c8016db50..91b4121615 100644--- a/saleor/graphql/account/mutations/permission_group/permission_group_update.py+++ b/saleor/graphql/account/mutations/permission_group/permission_group_update.py@@ -10,6 +10,7 @@ from .....account.models import Userfrom .....channel.models import Channelfrom .....core.tracing import traced_atomic_transactionfrom .....permission.enums import AccountPermissions, get_permissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.utils import (can_user_manage_group_channels,can_user_manage_group_permissions,@@ -22,6 +23,7 @@ from ....core.descriptions import ADDED_IN_314, PREVIEW_FEATUREfrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.enums import PermissionEnumfrom ....core.types import NonNullList, PermissionGroupError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ....utils.validators import check_for_duplicatesfrom ...dataloaders import AccessibleChannelsByGroupIdLoader@@ -75,6 +77,11 @@ class PermissionGroupUpdate(PermissionGroupCreate):permissions = (AccountPermissions.MANAGE_STAFF,)error_type_class = PermissionGroupErrorerror_type_field = "permission_group_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.PERMISSION_GROUP_UPDATED,+ )+ ]@classmethoddef _save_m2m(cls, info: ResolveInfo, instance, cleaned_data):diff --git a/saleor/graphql/account/mutations/staff/address_create.py b/saleor/graphql/account/mutations/staff/address_create.pyindex eb6c762882..7f754b4caa 100644--- a/saleor/graphql/account/mutations/staff/address_create.py+++ b/saleor/graphql/account/mutations/staff/address_create.py@@ -7,11 +7,13 @@ from .....account.utils import ()from .....core.tracing import traced_atomic_transactionfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Address, AddressInput, Userfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import ModelMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...i18n import I18nMixin@@ -37,6 +39,12 @@ class AddressCreate(ModelMutation, I18nMixin):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_CREATED,+ description="A new address was created.",+ ),+ ]@classmethoddef perform_mutation(cls, root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/account/mutations/staff/address_delete.py b/saleor/graphql/account/mutations/staff/address_delete.pyindex 7176f48cc0..93a985a91b 100644--- a/saleor/graphql/account/mutations/staff/address_delete.py+++ b/saleor/graphql/account/mutations/staff/address_delete.py@@ -1,8 +1,10 @@from .....account import modelsfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Addressfrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ..base import BaseAddressDelete@@ -15,3 +17,9 @@ class AddressDelete(BaseAddressDelete):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_DELETED,+ description="An address was deleted.",+ )+ ]diff --git a/saleor/graphql/account/mutations/staff/address_set_default.py b/saleor/graphql/account/mutations/staff/address_set_default.pyindex 7d7b277c7f..61bd1dead7 100644--- a/saleor/graphql/account/mutations/staff/address_set_default.py+++ b/saleor/graphql/account/mutations/staff/address_set_default.py@@ -5,12 +5,14 @@ from .....account import utilsfrom .....account.error_codes import AccountErrorCodefrom .....checkout import AddressTypefrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.enums import AddressTypeEnumfrom ....account.types import Address, Userfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import BaseMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promise@@ -30,6 +32,12 @@ class AddressSetDefault(BaseMutation):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A customer was updated.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/account/mutations/staff/address_update.py b/saleor/graphql/account/mutations/staff/address_update.pyindex c5e228a919..dafb4fae14 100644--- a/saleor/graphql/account/mutations/staff/address_update.py+++ b/saleor/graphql/account/mutations/staff/address_update.py@@ -1,8 +1,10 @@from .....account import modelsfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Addressfrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ..base import BaseAddressUpdate@@ -15,3 +17,9 @@ class AddressUpdate(BaseAddressUpdate):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ADDRESS_UPDATED,+ description="An address was updated.",+ ),+ ]diff --git a/saleor/graphql/account/mutations/staff/customer_create.py b/saleor/graphql/account/mutations/staff/customer_create.pyindex badba54ba3..4cf1d3f40c 100644--- a/saleor/graphql/account/mutations/staff/customer_create.py+++ b/saleor/graphql/account/mutations/staff/customer_create.py@@ -1,8 +1,10 @@from .....account import modelsfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ..base import BaseCustomerCreate@@ -18,3 +20,17 @@ class CustomerCreate(BaseCustomerCreate):support_private_meta_field = Trueerror_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_CREATED,+ description="A new customer account was created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_METADATA_UPDATED,+ description="Optionally called when customer's metadata was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for setting the password.",+ ),+ ]diff --git a/saleor/graphql/account/mutations/staff/customer_delete.py b/saleor/graphql/account/mutations/staff/customer_delete.pyindex e074e844f1..e23cb86f6d 100644--- a/saleor/graphql/account/mutations/staff/customer_delete.py+++ b/saleor/graphql/account/mutations/staff/customer_delete.py@@ -2,11 +2,13 @@ import graphenefrom .....account import modelsfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....core import ResolveInfofrom ....core.descriptions import ADDED_IN_310from ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ..base import CustomerDeleteMixinfrom .base import UserDelete@@ -21,6 +23,12 @@ class CustomerDelete(CustomerDeleteMixin, UserDelete):permissions = (AccountPermissions.MANAGE_USERS,)error_type_class = AccountErrorerror_type_field = "account_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_DELETED,+ description="A customer account was deleted.",+ )+ ]class Arguments:id = graphene.ID(required=False, description="ID of a customer to delete.")diff --git a/saleor/graphql/account/mutations/staff/customer_update.py b/saleor/graphql/account/mutations/staff/customer_update.pyindex 0e1eac4d77..ddca1b32dc 100644--- a/saleor/graphql/account/mutations/staff/customer_update.py+++ b/saleor/graphql/account/mutations/staff/customer_update.py@@ -7,6 +7,7 @@ from .....account import modelsfrom .....giftcard.utils import assign_user_gift_cardsfrom .....order.utils import match_orders_with_new_userfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....app.dataloaders import get_app_promisefrom ....core import ResolveInfo@@ -14,6 +15,7 @@ from ....core.descriptions import ADDED_IN_310from ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import ModelWithExtRefMutationfrom ....core.types import AccountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ..base import CustomerInputfrom .customer_create import CustomerCreate@@ -41,6 +43,16 @@ class CustomerUpdate(CustomerCreate, ModelWithExtRefMutation):error_type_field = "account_errors"support_meta_field = Truesupport_private_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_UPDATED,+ description="A new customer account was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CUSTOMER_METADATA_UPDATED,+ description="Optionally called when customer's metadata was updated.",+ ),+ ]@classmethoddef generate_events(diff --git a/saleor/graphql/account/mutations/staff/staff_create.py b/saleor/graphql/account/mutations/staff/staff_create.pyindex 2b904a6630..9189e37f4e 100644--- a/saleor/graphql/account/mutations/staff/staff_create.py+++ b/saleor/graphql/account/mutations/staff/staff_create.py@@ -12,12 +12,14 @@ from .....core.exceptions import PermissionDeniedfrom .....core.tracing import traced_atomic_transactionfrom .....core.utils.url import validate_storefront_urlfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....app.dataloaders import get_app_promisefrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.mutations import ModelMutationfrom ....core.types import NonNullList, StaffError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_groups_which_user_can_managefrom ..base import UserInput@@ -64,6 +66,16 @@ class StaffCreate(ModelMutation):error_type_field = "staff_errors"support_meta_field = Truesupport_private_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.STAFF_CREATED,+ description="A new staff account was created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for setting the password.",+ ),+ ]@classmethoddef check_permissions(cls, context, permissions=None, **data):diff --git a/saleor/graphql/account/mutations/staff/staff_delete.py b/saleor/graphql/account/mutations/staff/staff_delete.pyindex ce7f565bcd..5dc751d121 100644--- a/saleor/graphql/account/mutations/staff/staff_delete.py+++ b/saleor/graphql/account/mutations/staff/staff_delete.py@@ -3,10 +3,12 @@ import graphenefrom .....account import modelsfrom .....account.utils import remove_staff_memberfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import StaffError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ..base import StaffDeleteMixinfrom .base import UserDelete@@ -23,6 +25,12 @@ class StaffDelete(StaffDeleteMixin, UserDelete):permissions = (AccountPermissions.MANAGE_STAFF,)error_type_class = StaffErrorerror_type_field = "staff_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.STAFF_DELETED,+ description="A staff account was deleted.",+ ),+ ]class Arguments:id = graphene.ID(required=True, description="ID of a staff user to delete.")diff --git a/saleor/graphql/account/mutations/staff/staff_update.py b/saleor/graphql/account/mutations/staff/staff_update.pyindex d61a3c4f2e..77fa84058d 100644--- a/saleor/graphql/account/mutations/staff/staff_update.py+++ b/saleor/graphql/account/mutations/staff/staff_update.py@@ -9,10 +9,12 @@ from .....core.tracing import traced_atomic_transactionfrom .....giftcard.utils import assign_user_gift_cardsfrom .....order.utils import match_orders_with_new_userfrom .....permission.enums import AccountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....account.types import Userfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_USERSfrom ....core.types import NonNullList, StaffError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ....utils.validators import check_for_duplicatesfrom ...utils import (@@ -57,6 +59,12 @@ class StaffUpdate(StaffCreate):error_type_field = "staff_errors"support_meta_field = Truesupport_private_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.STAFF_UPDATED,+ description="A staff account was updated.",+ ),+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/api.py b/saleor/graphql/api.pyindex 0c75bfb3dd..511a5ed5b3 100644--- a/saleor/graphql/api.py+++ b/saleor/graphql/api.py@@ -1,6 +1,7 @@import graphqlfrom django.urls import reversefrom django.utils.functional import SimpleLazyObject+from graphql import GraphQLScalarTypefrom ..graphql.notifications.schema import ExternalNotificationMutationsfrom .account.schema import AccountMutations, AccountQueries@@ -113,10 +114,57 @@ GraphQLDocDirective = graphql.GraphQLDirective()+def serialize_webhook_event(value):+ return value+++GraphQLWebhookEventAsyncType = GraphQLScalarType(+ name="WebhookEventTypeAsyncEnum",+ description="",+ serialize=serialize_webhook_event,+)++GraphQLWebhookEventSyncType = GraphQLScalarType(+ name="WebhookEventTypeSyncEnum",+ description="",+ serialize=serialize_webhook_event,+)++GraphQLWebhookEventsInfoDirective = graphql.GraphQLDirective(+ name="webhookEventsInfo",+ description="Webhook events triggered by a specific location.",+ args={+ "asyncEvents": graphql.GraphQLArgument(+ type_=graphql.GraphQLNonNull(+ graphql.GraphQLList(+ graphql.GraphQLNonNull(GraphQLWebhookEventAsyncType)+ )+ ),+ description=(+ "List of asynchronous webhook events triggered by a specific location."+ ),+ ),+ "syncEvents": graphql.GraphQLArgument(+ type_=graphql.GraphQLNonNull(+ graphql.GraphQLList(graphql.GraphQLNonNull(GraphQLWebhookEventSyncType))+ ),+ description=(+ "List of synchronous webhook events triggered by a specific location."+ ),+ ),+ },+ locations=[+ graphql.DirectiveLocation.FIELD,+ graphql.DirectiveLocation.FIELD_DEFINITION,+ graphql.DirectiveLocation.INPUT_OBJECT,+ graphql.DirectiveLocation.OBJECT,+ ],+)schema = build_federated_schema(Query,mutation=Mutation,types=unit_enums + list(WEBHOOK_TYPES_MAP.values()),subscription=Subscription,- directives=graphql.specified_directives + [GraphQLDocDirective],+ directives=graphql.specified_directives+ + [GraphQLDocDirective, GraphQLWebhookEventsInfoDirective],)diff --git a/saleor/graphql/app/mutations/app_activate.py b/saleor/graphql/app/mutations/app_activate.pyindex abdd03bd9a..d4bbbabe47 100644--- a/saleor/graphql/app/mutations/app_activate.py+++ b/saleor/graphql/app/mutations/app_activate.py@@ -2,8 +2,10 @@ import graphenefrom ....app import modelsfrom ....permission.enums import AppPermission+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core.mutations import ModelMutationfrom ...core.types import AppError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import App@@ -19,6 +21,12 @@ class AppActivate(ModelMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_STATUS_CHANGED,+ description="An app was activated.",+ ),+ ]@classmethoddef perform_mutation(cls, _root, info, /, *, id):diff --git a/saleor/graphql/app/mutations/app_create.py b/saleor/graphql/app/mutations/app_create.pyindex 28b5740f46..e2bcefe68e 100644--- a/saleor/graphql/app/mutations/app_create.py+++ b/saleor/graphql/app/mutations/app_create.py@@ -2,10 +2,12 @@ import graphenefrom ....app import modelsfrom ....permission.enums import AppPermission, get_permissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core.doc_category import DOC_CATEGORY_APPSfrom ...core.enums import PermissionEnumfrom ...core.mutations import ModelMutationfrom ...core.types import AppError, BaseInputObjectType, NonNullList+from ...core.utils import WebhookEventInfofrom ...decorators import staff_member_requiredfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_user_or_app_from_context@@ -46,6 +48,12 @@ class AppCreate(ModelMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_INSTALLED,+ description="An app was installed.",+ ),+ ]@classmethoddef clean_input(cls, info, instance, data, **kwargs):diff --git a/saleor/graphql/app/mutations/app_deactivate.py b/saleor/graphql/app/mutations/app_deactivate.pyindex 339c99408e..097e8e1740 100644--- a/saleor/graphql/app/mutations/app_deactivate.py+++ b/saleor/graphql/app/mutations/app_deactivate.py@@ -2,8 +2,10 @@ import graphenefrom ....app import modelsfrom ....permission.enums import AppPermission+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core.mutations import ModelMutationfrom ...core.types import AppError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import App@@ -19,6 +21,12 @@ class AppDeactivate(ModelMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_STATUS_CHANGED,+ description="An app was deactivated.",+ ),+ ]@classmethoddef perform_mutation(cls, _root, info, /, *, id):diff --git a/saleor/graphql/app/mutations/app_delete.py b/saleor/graphql/app/mutations/app_delete.pyindex 9403fe012f..5c7f4179c4 100644--- a/saleor/graphql/app/mutations/app_delete.py+++ b/saleor/graphql/app/mutations/app_delete.py@@ -4,10 +4,12 @@ from django.core.exceptions import ValidationErrorfrom ....app import modelsfrom ....app.error_codes import AppErrorCodefrom ....permission.enums import AppPermission+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.utils import can_manage_appfrom ...core import ResolveInfofrom ...core.mutations import ModelDeleteMutationfrom ...core.types import AppError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_user_or_app_from_context, requestor_is_superuserfrom ..types import App@@ -24,6 +26,12 @@ class AppDelete(ModelDeleteMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_DELETED,+ description="An app was deleted.",+ ),+ ]@classmethoddef clean_instance(cls, info: ResolveInfo, instance):diff --git a/saleor/graphql/app/mutations/app_install.py b/saleor/graphql/app/mutations/app_install.pyindex b5c5b8e812..73420fd169 100644--- a/saleor/graphql/app/mutations/app_install.py+++ b/saleor/graphql/app/mutations/app_install.py@@ -4,10 +4,12 @@ from ....app import modelsfrom ....app.manifest_validations import clean_manifest_urlfrom ....app.tasks import install_app_taskfrom ....permission.enums import AppPermission, get_permissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core.doc_category import DOC_CATEGORY_APPSfrom ...core.enums import PermissionEnumfrom ...core.mutations import ModelMutationfrom ...core.types import AppError, BaseInputObjectType, NonNullList+from ...core.utils import WebhookEventInfofrom ...decorators import staff_member_requiredfrom ...utils import get_user_or_app_from_contextfrom ..types import AppInstallation@@ -29,6 +31,12 @@ class AppInstallInput(BaseInputObjectType):class Meta:doc_category = DOC_CATEGORY_APPS+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_INSTALLED,+ description="An app was installed.",+ ),+ ]class AppInstall(ModelMutation):diff --git a/saleor/graphql/app/mutations/app_retry_install.py b/saleor/graphql/app/mutations/app_retry_install.pyindex 35e0d68622..64faee9ee4 100644--- a/saleor/graphql/app/mutations/app_retry_install.py+++ b/saleor/graphql/app/mutations/app_retry_install.py@@ -6,9 +6,11 @@ from ....app.error_codes import AppErrorCodefrom ....app.tasks import install_app_taskfrom ....core import JobStatusfrom ....permission.enums import AppPermission+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.mutations import ModelMutationfrom ...core.types import AppError+from ...core.utils import WebhookEventInfofrom ..types import AppInstallation@@ -28,6 +30,12 @@ class AppRetryInstall(ModelMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_INSTALLED,+ description="An app was installed.",+ ),+ ]@classmethoddef save(cls, _info: ResolveInfo, instance, _cleaned_input, /):diff --git a/saleor/graphql/app/mutations/app_update.py b/saleor/graphql/app/mutations/app_update.pyindex 0be3fe4e12..e2d15d7f28 100644--- a/saleor/graphql/app/mutations/app_update.py+++ b/saleor/graphql/app/mutations/app_update.py@@ -4,9 +4,11 @@ from django.core.exceptions import ValidationErrorfrom ....app import modelsfrom ....app.error_codes import AppErrorCodefrom ....permission.enums import AppPermission, get_permissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.utils import can_manage_appfrom ...core.mutations import ModelMutationfrom ...core.types import AppError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_user_or_app_from_context, requestor_is_superuserfrom ..types import App@@ -29,6 +31,12 @@ class AppUpdate(ModelMutation):permissions = (AppPermission.MANAGE_APPS,)error_type_class = AppErrorerror_type_field = "app_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.APP_UPDATED,+ description="An app was updated.",+ ),+ ]@classmethoddef clean_input(cls, info, instance, data, **kwargs):diff --git a/saleor/graphql/attribute/bulk_mutations.py b/saleor/graphql/attribute/bulk_mutations.pyindex 8ad9e9b0ff..d1c947be4e 100644--- a/saleor/graphql/attribute/bulk_mutations.py+++ b/saleor/graphql/attribute/bulk_mutations.py@@ -5,9 +5,11 @@ from ...attribute import modelsfrom ...permission.enums import PageTypePermissionsfrom ...product import models as product_modelsfrom ...product.search import update_products_search_vector+from ...webhook.event_types import WebhookEventAsyncTypefrom ..core import ResolveInfofrom ..core.mutations import ModelBulkDeleteMutationfrom ..core.types import AttributeError, NonNullList+from ..core.utils import WebhookEventInfofrom ..plugins.dataloaders import get_plugin_manager_promisefrom ..utils import resolve_global_ids_to_primary_keysfrom .types import Attribute, AttributeValue@@ -26,6 +28,12 @@ class AttributeBulkDelete(ModelBulkDeleteMutation):permissions = (PageTypePermissions.MANAGE_PAGE_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_DELETED,+ description="An attribute was deleted.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]@@ -90,6 +98,16 @@ class AttributeValueBulkDelete(ModelBulkDeleteMutation):permissions = (PageTypePermissions.MANAGE_PAGE_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_VALUE_DELETED,+ description="An attribute value was deleted.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/attribute/mutations/attribute_create.py b/saleor/graphql/attribute/mutations/attribute_create.pyindex 4921da7aa8..90fddaca4d 100644--- a/saleor/graphql/attribute/mutations/attribute_create.py+++ b/saleor/graphql/attribute/mutations/attribute_create.py@@ -8,6 +8,7 @@ from ....attribute import models as modelsfrom ....attribute.error_codes import AttributeErrorCodefrom ....core.exceptions import PermissionDeniedfrom ....permission.enums import PageTypePermissions, ProductTypePermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_310, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_ATTRIBUTES@@ -15,6 +16,7 @@ from ...core.enums import MeasurementUnitsEnumfrom ...core.fields import JSONStringfrom ...core.mutations import ModelMutationfrom ...core.types import AttributeError, BaseInputObjectType, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..descriptions import AttributeDescriptions, AttributeValueDescriptionsfrom ..enums import AttributeEntityTypeEnum, AttributeInputTypeEnum, AttributeTypeEnum@@ -116,6 +118,12 @@ class AttributeCreate(AttributeMixin, ModelMutation):description = "Creates an attribute."error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_CREATED,+ description="An attribute was created.",+ ),+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/attribute/mutations/attribute_delete.py b/saleor/graphql/attribute/mutations/attribute_delete.pyindex 25cb169829..fb6e083e20 100644--- a/saleor/graphql/attribute/mutations/attribute_delete.py+++ b/saleor/graphql/attribute/mutations/attribute_delete.py@@ -2,10 +2,12 @@ import graphenefrom ....attribute import models as modelsfrom ....permission.enums import ProductTypePermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_310from ...core.mutations import ModelDeleteMutation, ModelWithExtRefMutationfrom ...core.types import AttributeError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Attribute@@ -25,6 +27,12 @@ class AttributeDelete(ModelDeleteMutation, ModelWithExtRefMutation):permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_DELETED,+ description="An attribute was deleted.",+ ),+ ]@classmethoddef post_save_action(cls, info: ResolveInfo, instance, cleaned_input):diff --git a/saleor/graphql/attribute/mutations/attribute_reorder_values.py b/saleor/graphql/attribute/mutations/attribute_reorder_values.pyindex 35a8b499fe..c8b9f9dab0 100644--- a/saleor/graphql/attribute/mutations/attribute_reorder_values.py+++ b/saleor/graphql/attribute/mutations/attribute_reorder_values.py@@ -5,11 +5,13 @@ from ....attribute import models as modelsfrom ....attribute.error_codes import AttributeErrorCodefrom ....core.tracing import traced_atomic_transactionfrom ....permission.enums import ProductTypePermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_ATTRIBUTESfrom ...core.inputs import ReorderInputfrom ...core.mutations import BaseMutationfrom ...core.types import AttributeError, NonNullList+from ...core.utils import WebhookEventInfofrom ...core.utils.reordering import perform_reorderingfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Attribute, AttributeValue@@ -26,6 +28,16 @@ class AttributeReorderValues(BaseMutation):permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_VALUE_UPDATED,+ description="An attribute value was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]class Arguments:attribute_id = graphene.Argument(diff --git a/saleor/graphql/attribute/mutations/attribute_update.py b/saleor/graphql/attribute/mutations/attribute_update.pyindex b41d565ef7..76d7f5284f 100644--- a/saleor/graphql/attribute/mutations/attribute_update.py+++ b/saleor/graphql/attribute/mutations/attribute_update.py@@ -4,12 +4,14 @@ from django.core.exceptions import ValidationErrorfrom ....attribute import models as modelsfrom ....attribute.error_codes import AttributeErrorCodefrom ....permission.enums import ProductTypePermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_310, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_ATTRIBUTESfrom ...core.enums import MeasurementUnitsEnumfrom ...core.mutations import ModelWithExtRefMutationfrom ...core.types import AttributeError, BaseInputObjectType, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..descriptions import AttributeDescriptions, AttributeValueDescriptionsfrom ..types import Attribute@@ -93,6 +95,12 @@ class AttributeUpdate(AttributeMixin, ModelWithExtRefMutation):permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]@classmethoddef clean_remove_values(cls, cleaned_input, instance):diff --git a/saleor/graphql/attribute/mutations/attribute_value_create.py b/saleor/graphql/attribute/mutations/attribute_value_create.pyindex f05e3be7ed..2f6dbb4917 100644--- a/saleor/graphql/attribute/mutations/attribute_value_create.py+++ b/saleor/graphql/attribute/mutations/attribute_value_create.py@@ -8,9 +8,11 @@ from ....attribute import models as modelsfrom ....attribute.error_codes import AttributeErrorCodefrom ....core.utils import generate_unique_slugfrom ....permission.enums import ProductPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.mutations import ModelMutationfrom ...core.types import AttributeError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Attribute, AttributeValuefrom .attribute_create import AttributeValueCreateInput@@ -40,6 +42,16 @@ class AttributeValueCreate(AttributeMixin, ModelMutation):permissions = (ProductPermissions.MANAGE_PRODUCTS,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_VALUE_CREATED,+ description="An attribute value was created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/attribute/mutations/attribute_value_delete.py b/saleor/graphql/attribute/mutations/attribute_value_delete.pyindex 6c6991ff8a..81832b351a 100644--- a/saleor/graphql/attribute/mutations/attribute_value_delete.py+++ b/saleor/graphql/attribute/mutations/attribute_value_delete.py@@ -4,10 +4,12 @@ from django.db.models import Exists, OuterRef, Qfrom ....attribute import models as modelsfrom ....permission.enums import ProductTypePermissionsfrom ....product import models as product_models+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_310from ...core.mutations import ModelDeleteMutation, ModelWithExtRefMutationfrom ...core.types import AttributeError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Attribute, AttributeValue@@ -29,6 +31,16 @@ class AttributeValueDelete(ModelDeleteMutation, ModelWithExtRefMutation):permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_VALUE_DELETED,+ description="An attribute value was deleted.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/attribute/mutations/attribute_value_update.py b/saleor/graphql/attribute/mutations/attribute_value_update.pyindex 1d1a929e64..34b0fb0859 100644--- a/saleor/graphql/attribute/mutations/attribute_value_update.py+++ b/saleor/graphql/attribute/mutations/attribute_value_update.py@@ -5,10 +5,12 @@ from django.db.models import Exists, OuterRef, Qfrom ....attribute import models as modelsfrom ....permission.enums import ProductTypePermissionsfrom ....product import models as product_models+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_310from ...core.mutations import ModelWithExtRefMutationfrom ...core.types import AttributeError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Attribute, AttributeValuefrom .attribute_update import AttributeValueUpdateInput@@ -58,6 +60,16 @@ class AttributeValueUpdate(AttributeValueCreate, ModelWithExtRefMutation):permissions = (ProductTypePermissions.MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES,)error_type_class = AttributeErrorerror_type_field = "attribute_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_VALUE_UPDATED,+ description="An attribute value was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ATTRIBUTE_UPDATED,+ description="An attribute was updated.",+ ),+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/channel/mutations/channel_activate.py b/saleor/graphql/channel/mutations/channel_activate.pyindex 544a418049..a0f0b157b1 100644--- a/saleor/graphql/channel/mutations/channel_activate.py+++ b/saleor/graphql/channel/mutations/channel_activate.py@@ -3,10 +3,12 @@ from django.core.exceptions import ValidationErrorfrom ....channel.error_codes import ChannelErrorCodefrom ....permission.enums import ChannelPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_CHANNELSfrom ...core.mutations import BaseMutationfrom ...core.types import ChannelError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Channel@@ -23,6 +25,12 @@ class ChannelActivate(BaseMutation):permissions = (ChannelPermissions.MANAGE_CHANNELS,)error_type_class = ChannelErrorerror_type_field = "channel_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHANNEL_STATUS_CHANGED,+ description="A channel was activated.",+ ),+ ]@classmethoddef clean_channel_availability(cls, channel):diff --git a/saleor/graphql/channel/mutations/channel_create.py b/saleor/graphql/channel/mutations/channel_create.pyindex 85ec8e5e65..65b6046be9 100644--- a/saleor/graphql/channel/mutations/channel_create.py+++ b/saleor/graphql/channel/mutations/channel_create.py@@ -5,6 +5,7 @@ from ....channel import modelsfrom ....core.tracing import traced_atomic_transactionfrom ....permission.enums import ChannelPermissionsfrom ....tax.models import TaxConfiguration+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.enums import CountryCodeEnumfrom ...core import ResolveInfofrom ...core.descriptions import (@@ -24,6 +25,7 @@ from ...core.doc_category import (from ...core.mutations import ModelMutationfrom ...core.scalars import Day, Minutefrom ...core.types import BaseInputObjectType, ChannelError, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..enums import (AllocationStrategyEnum,@@ -160,6 +162,12 @@ class ChannelCreate(ModelMutation):permissions = (ChannelPermissions.MANAGE_CHANNELS,)error_type_class = ChannelErrorerror_type_field = "channel_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHANNEL_CREATED,+ description="A channel was created.",+ ),+ ]@classmethoddef get_type_for_model(cls):diff --git a/saleor/graphql/channel/mutations/channel_deactivate.py b/saleor/graphql/channel/mutations/channel_deactivate.pyindex 1445aa80f7..ffc5d4a53d 100644--- a/saleor/graphql/channel/mutations/channel_deactivate.py+++ b/saleor/graphql/channel/mutations/channel_deactivate.py@@ -3,10 +3,12 @@ from django.core.exceptions import ValidationErrorfrom ....channel.error_codes import ChannelErrorCodefrom ....permission.enums import ChannelPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_CHANNELSfrom ...core.mutations import BaseMutationfrom ...core.types import ChannelError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Channel@@ -23,6 +25,12 @@ class ChannelDeactivate(BaseMutation):permissions = (ChannelPermissions.MANAGE_CHANNELS,)error_type_class = ChannelErrorerror_type_field = "channel_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHANNEL_STATUS_CHANGED,+ description="A channel was deactivated.",+ ),+ ]@classmethoddef clean_channel_availability(cls, channel):diff --git a/saleor/graphql/channel/mutations/channel_delete.py b/saleor/graphql/channel/mutations/channel_delete.pyindex 3fa03fe939..b2820f863c 100644--- a/saleor/graphql/channel/mutations/channel_delete.py+++ b/saleor/graphql/channel/mutations/channel_delete.py@@ -9,10 +9,12 @@ from ....checkout.models import Checkoutfrom ....core.tracing import traced_atomic_transactionfrom ....order.models import Orderfrom ....permission.enums import ChannelPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_CHANNELSfrom ...core.mutations import ModelDeleteMutationfrom ...core.types import BaseInputObjectType, ChannelError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Channelfrom ..utils import delete_invalid_warehouse_to_shipping_zone_relations@@ -44,6 +46,12 @@ class ChannelDelete(ModelDeleteMutation):permissions = (ChannelPermissions.MANAGE_CHANNELS,)error_type_class = ChannelErrorerror_type_field = "channel_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHANNEL_DELETED,+ description="A channel was deleted.",+ ),+ ]@classmethoddef validate_input(cls, origin_channel, target_channel):diff --git a/saleor/graphql/channel/mutations/channel_update.py b/saleor/graphql/channel/mutations/channel_update.pyindex 6f98fd48f0..ee22294837 100644--- a/saleor/graphql/channel/mutations/channel_update.py+++ b/saleor/graphql/channel/mutations/channel_update.py@@ -9,12 +9,14 @@ from ....permission.enums import ChannelPermissions, OrderPermissionsfrom ....shipping.tasks import (drop_invalid_shipping_methods_relations_for_given_channels,)+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.enums import CountryCodeEnumfrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_31, ADDED_IN_35from ...core.doc_category import DOC_CATEGORY_CHANNELSfrom ...core.mutations import ModelMutationfrom ...core.types import ChannelError, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils.validators import check_for_duplicatesfrom ..types import Channel@@ -68,6 +70,12 @@ class ChannelUpdate(ModelMutation):object_type = Channelerror_type_class = ChannelErrorerror_type_field = "channel_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHANNEL_UPDATED,+ description="A channel was updated.",+ ),+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/checkout/mutations/checkout_add_promo_code.py b/saleor/graphql/checkout/mutations/checkout_add_promo_code.pyindex 0aead36ff0..c32906a4cb 100644--- a/saleor/graphql/checkout/mutations/checkout_add_promo_code.py+++ b/saleor/graphql/checkout/mutations/checkout_add_promo_code.py@@ -8,12 +8,14 @@ from ....checkout.fetch import (update_delivery_method_lists_for_checkout_info,)from ....checkout.utils import add_promo_code_to_checkout, invalidate_checkout_prices+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Checkoutfrom .utils import get_checkout, update_checkout_shipping_method_if_invalid@@ -48,6 +50,12 @@ class CheckoutAddPromoCode(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/checkout/mutations/checkout_billing_address_update.py b/saleor/graphql/checkout/mutations/checkout_billing_address_update.pyindex d7751901c7..09a5536ae0 100644--- a/saleor/graphql/checkout/mutations/checkout_billing_address_update.py+++ b/saleor/graphql/checkout/mutations/checkout_billing_address_update.py@@ -7,12 +7,14 @@ from ....checkout.utils import (invalidate_checkout_prices,)from ....core.tracing import traced_atomic_transaction+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.types import AddressInputfrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, ADDED_IN_35, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Checkoutfrom .checkout_create import CheckoutAddressValidationRules@@ -54,6 +56,12 @@ class CheckoutBillingAddressUpdate(CheckoutShippingAddressUpdate):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/checkout/mutations/checkout_complete.py b/saleor/graphql/checkout/mutations/checkout_complete.pyindex ff76ae4ab3..cbd67a0864 100644--- a/saleor/graphql/checkout/mutations/checkout_complete.py+++ b/saleor/graphql/checkout/mutations/checkout_complete.py@@ -19,6 +19,7 @@ from ....checkout.fetch import (from ....checkout.utils import is_shipping_requiredfrom ....order import models as order_modelsfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncType, WebhookEventSyncTypefrom ...account.i18n import I18nMixinfrom ...app.dataloaders import get_app_promisefrom ...core import ResolveInfo@@ -28,6 +29,7 @@ from ...core.fields import JSONStringfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError, NonNullList+from ...core.utils import CHECKOUT_CALCULATE_TAXES_MESSAGE, WebhookEventInfofrom ...core.validators import validate_one_of_args_is_in_mutationfrom ...meta.inputs import MetadataInputfrom ...order.types import Order@@ -110,6 +112,59 @@ class CheckoutComplete(BaseMutation, I18nMixin):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_CREATED,+ description="Triggered when order is created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for order placement.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A staff notification for order placement.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_UPDATED,+ description=(+ "Triggered when order received the update after placement."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_PAID,+ description="Triggered when newly created order is paid.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_FULLY_PAID,+ description="Triggered when newly created order is fully paid.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_CONFIRMED,+ description=(+ "Optionally triggered when newly created order are automatically "+ "marked as confirmed."+ ),+ ),+ ]@classmethoddef validate_checkout_addresses(diff --git a/saleor/graphql/checkout/mutations/checkout_create.py b/saleor/graphql/checkout/mutations/checkout_create.pyindex 08e6be010f..d4e62a1337 100644--- a/saleor/graphql/checkout/mutations/checkout_create.py+++ b/saleor/graphql/checkout/mutations/checkout_create.py@@ -10,6 +10,7 @@ from ....core.tracing import traced_atomic_transactionfrom ....core.utils.country import get_active_countryfrom ....product import models as product_modelsfrom ....warehouse.reservations import get_reservation_length, is_reservation_enabled+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.i18n import I18nMixinfrom ...account.types import AddressInputfrom ...app.dataloaders import get_app_promise@@ -27,6 +28,7 @@ from ...core.enums import LanguageCodeEnumfrom ...core.mutations import ModelMutationfrom ...core.scalars import PositiveDecimalfrom ...core.types import BaseInputObjectType, CheckoutError, NonNullList+from ...core.utils import WebhookEventInfofrom ...core.validators import validate_variants_available_in_channelfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...product.types import ProductVariant@@ -186,6 +188,12 @@ class CheckoutCreate(ModelMutation, I18nMixin):return_field_name = "checkout"error_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_CREATED,+ description="A checkout was created.",+ )+ ]@classmethoddef clean_checkout_lines(diff --git a/saleor/graphql/checkout/mutations/checkout_customer_attach.py b/saleor/graphql/checkout/mutations/checkout_customer_attach.pyindex 7bf858cd5b..e2d8a7e84d 100644--- a/saleor/graphql/checkout/mutations/checkout_customer_attach.py+++ b/saleor/graphql/checkout/mutations/checkout_customer_attach.py@@ -5,6 +5,7 @@ from ....checkout.error_codes import CheckoutErrorCodefrom ....core.exceptions import PermissionDeniedfrom ....permission.auth_filters import AuthorizationFiltersfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.types import Userfrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUT@@ -12,6 +13,7 @@ from ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_user_or_app_from_contextfrom ..types import Checkout@@ -54,6 +56,12 @@ class CheckoutCustomerAttach(BaseMutation):AuthorizationFilters.AUTHENTICATED_APP,AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation(diff --git a/saleor/graphql/checkout/mutations/checkout_customer_detach.py b/saleor/graphql/checkout/mutations/checkout_customer_detach.pyindex 17e1491c64..445ca02155 100644--- a/saleor/graphql/checkout/mutations/checkout_customer_detach.py+++ b/saleor/graphql/checkout/mutations/checkout_customer_detach.py@@ -3,12 +3,14 @@ import graphenefrom ....core.exceptions import PermissionDeniedfrom ....permission.auth_filters import AuthorizationFiltersfrom ....permission.enums import AccountPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import get_user_or_app_from_contextfrom ..types import Checkout@@ -43,6 +45,12 @@ class CheckoutCustomerDetach(BaseMutation):AuthorizationFilters.AUTHENTICATED_APP,AuthorizationFilters.AUTHENTICATED_USER,)+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation(diff --git a/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py b/saleor/graphql/checkout/mutations/checkout_delivery_method_update.pyindex 81d177d169..099e960ea4 100644--- a/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py+++ b/saleor/graphql/checkout/mutations/checkout_delivery_method_update.py@@ -22,13 +22,14 @@ from ....shipping import interface as shipping_interfacefrom ....shipping import models as shipping_modelsfrom ....shipping.utils import convert_to_shipping_method_datafrom ....warehouse import models as warehouse_models+from ....webhook.event_types import WebhookEventAsyncType, WebhookEventSyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_31, ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError-from ...core.utils import from_global_id_or_error+from ...core.utils import WebhookEventInfo, from_global_id_or_errorfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...shipping.types import ShippingMethodfrom ...warehouse.types import Warehouse@@ -61,6 +62,19 @@ class CheckoutDeliveryMethodUpdate(BaseMutation):)doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutError+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Triggered when updating the checkout delivery method with "+ "the external one."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ ),+ ]@classmethoddef perform_on_shipping_method(diff --git a/saleor/graphql/checkout/mutations/checkout_email_update.py b/saleor/graphql/checkout/mutations/checkout_email_update.pyindex 713c655f6f..18d2fdf568 100644--- a/saleor/graphql/checkout/mutations/checkout_email_update.py+++ b/saleor/graphql/checkout/mutations/checkout_email_update.py@@ -2,12 +2,14 @@ import graphenefrom django.core.exceptions import ValidationErrorfrom ....checkout.error_codes import CheckoutErrorCode+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Checkoutfrom .utils import get_checkout@@ -38,6 +40,12 @@ class CheckoutEmailUpdate(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@staticmethoddef clean_email(email):diff --git a/saleor/graphql/checkout/mutations/checkout_language_code_update.py b/saleor/graphql/checkout/mutations/checkout_language_code_update.pyindex 8007bdf550..2da8f5d51c 100644--- a/saleor/graphql/checkout/mutations/checkout_language_code_update.py+++ b/saleor/graphql/checkout/mutations/checkout_language_code_update.py@@ -1,5 +1,7 @@import graphene+from saleor.webhook.event_types import WebhookEventAsyncType+from ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUT@@ -7,6 +9,7 @@ from ...core.enums import LanguageCodeEnumfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Checkoutfrom .utils import get_checkout@@ -39,6 +42,12 @@ class CheckoutLanguageCodeUpdate(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/checkout/mutations/checkout_line_delete.py b/saleor/graphql/checkout/mutations/checkout_line_delete.pyindex f93cc82f1b..68358da327 100644--- a/saleor/graphql/checkout/mutations/checkout_line_delete.py+++ b/saleor/graphql/checkout/mutations/checkout_line_delete.py@@ -2,12 +2,14 @@ import graphenefrom ....checkout.fetch import fetch_checkout_info, fetch_checkout_linesfrom ....checkout.utils import invalidate_checkout_prices+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Checkout, CheckoutLinefrom .utils import get_checkout, update_checkout_shipping_method_if_invalid@@ -38,6 +40,12 @@ class CheckoutLineDelete(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/checkout/mutations/checkout_lines_add.py b/saleor/graphql/checkout/mutations/checkout_lines_add.pyindex df7227af85..58e1c0030c 100644--- a/saleor/graphql/checkout/mutations/checkout_lines_add.py+++ b/saleor/graphql/checkout/mutations/checkout_lines_add.py@@ -10,6 +10,7 @@ from ....checkout.fetch import ()from ....checkout.utils import add_variants_to_checkout, invalidate_checkout_pricesfrom ....warehouse.reservations import get_reservation_length, is_reservation_enabled+from ....webhook.event_types import WebhookEventAsyncTypefrom ...app.dataloaders import get_app_promisefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUT@@ -17,6 +18,7 @@ from ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError, NonNullList+from ...core.utils import WebhookEventInfofrom ...core.validators import validate_variants_available_in_channelfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...product.types import ProductVariant@@ -70,6 +72,12 @@ class CheckoutLinesAdd(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef validate_checkout_lines(diff --git a/saleor/graphql/checkout/mutations/checkout_lines_delete.py b/saleor/graphql/checkout/mutations/checkout_lines_delete.pyindex f009f4b26b..146f93cdfe 100644--- a/saleor/graphql/checkout/mutations/checkout_lines_delete.py+++ b/saleor/graphql/checkout/mutations/checkout_lines_delete.py@@ -3,12 +3,14 @@ from django.core.exceptions import ValidationErrorfrom ....checkout.fetch import fetch_checkout_info, fetch_checkout_linesfrom ....checkout.utils import invalidate_checkout_prices+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...utils import resolve_global_ids_to_primary_keysfrom ..types import Checkout@@ -37,6 +39,12 @@ class CheckoutLinesDelete(BaseMutation):description = "Deletes checkout lines."doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutError+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef validate_lines(cls, checkout, lines_to_delete):diff --git a/saleor/graphql/checkout/mutations/checkout_lines_update.py b/saleor/graphql/checkout/mutations/checkout_lines_update.pyindex b36068dd9f..0371e39469 100644--- a/saleor/graphql/checkout/mutations/checkout_lines_update.py+++ b/saleor/graphql/checkout/mutations/checkout_lines_update.py@@ -5,6 +5,7 @@ from django.forms import ValidationErrorfrom ....checkout.error_codes import CheckoutErrorCodefrom ....warehouse.reservations import is_reservation_enabled+from ....webhook.event_types import WebhookEventAsyncTypefrom ...app.dataloaders import get_app_promisefrom ...checkout.types import CheckoutLinefrom ...core import ResolveInfo@@ -17,6 +18,7 @@ from ...core.descriptions import (from ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.scalars import UUID, PositiveDecimalfrom ...core.types import BaseInputObjectType, CheckoutError, NonNullList+from ...core.utils import WebhookEventInfofrom ...core.validators import validate_one_of_args_is_in_mutationfrom ...product.types import ProductVariantfrom ...site.dataloaders import get_site_promise@@ -93,6 +95,12 @@ class CheckoutLinesUpdate(CheckoutLinesAdd):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef validate_checkout_lines(diff --git a/saleor/graphql/checkout/mutations/checkout_remove_promo_code.py b/saleor/graphql/checkout/mutations/checkout_remove_promo_code.pyindex 78e318ce19..227058a787 100644--- a/saleor/graphql/checkout/mutations/checkout_remove_promo_code.py+++ b/saleor/graphql/checkout/mutations/checkout_remove_promo_code.py@@ -12,13 +12,14 @@ from ....checkout.utils import (remove_promo_code_from_checkout,remove_voucher_from_checkout,)+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError-from ...core.utils import from_global_id_or_error+from ...core.utils import WebhookEventInfo, from_global_id_or_errorfrom ...core.validators import validate_one_of_args_is_in_mutationfrom ...discount.types import Voucherfrom ...giftcard.types import GiftCard@@ -60,6 +61,12 @@ class CheckoutRemovePromoCode(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef perform_mutation(diff --git a/saleor/graphql/checkout/mutations/checkout_shipping_address_update.py b/saleor/graphql/checkout/mutations/checkout_shipping_address_update.pyindex 6e50383d5d..806bb6043d 100644--- a/saleor/graphql/checkout/mutations/checkout_shipping_address_update.py+++ b/saleor/graphql/checkout/mutations/checkout_shipping_address_update.py@@ -17,6 +17,7 @@ from ....checkout.utils import ()from ....core.tracing import traced_atomic_transactionfrom ....warehouse.reservations import is_reservation_enabled+from ....webhook.event_types import WebhookEventAsyncTypefrom ...account.i18n import I18nMixinfrom ...account.types import AddressInputfrom ...core.descriptions import ADDED_IN_34, ADDED_IN_35, DEPRECATED_IN_3X_INPUT@@ -24,6 +25,7 @@ from ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...site.dataloaders import get_site_promisefrom ..types import Checkout@@ -74,6 +76,12 @@ class CheckoutShippingAddressUpdate(BaseMutation, I18nMixin):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ )+ ]@classmethoddef process_checkout_lines(diff --git a/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py b/saleor/graphql/checkout/mutations/checkout_shipping_method_update.pyindex ac39680f83..7d6a739707 100644--- a/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py+++ b/saleor/graphql/checkout/mutations/checkout_shipping_method_update.py@@ -16,13 +16,14 @@ from ....plugins.webhook.utils import APP_ID_PREFIXfrom ....shipping import interface as shipping_interfacefrom ....shipping import models as shipping_modelsfrom ....shipping.utils import convert_to_shipping_method_data+from ....webhook.event_types import WebhookEventAsyncType, WebhookEventSyncTypefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_34, DEPRECATED_IN_3X_INPUTfrom ...core.doc_category import DOC_CATEGORY_CHECKOUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUIDfrom ...core.types import CheckoutError-from ...core.utils import from_global_id_or_error+from ...core.utils import WebhookEventInfo, from_global_id_or_errorfrom ...plugins.dataloaders import get_plugin_manager_promisefrom ...shipping.types import ShippingMethodfrom ..types import Checkout@@ -54,6 +55,19 @@ class CheckoutShippingMethodUpdate(BaseMutation):doc_category = DOC_CATEGORY_CHECKOUTerror_type_class = CheckoutErrorerror_type_field = "checkout_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Triggered when updating the checkout shipping method with "+ "the external one."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.CHECKOUT_UPDATED,+ description="A checkout was updated.",+ ),+ ]@staticmethoddef _resolve_delivery_method_type(id_) -> Optional[str]:diff --git a/saleor/graphql/checkout/mutations/order_create_from_checkout.py b/saleor/graphql/checkout/mutations/order_create_from_checkout.pyindex e9c68696b1..5965c6ef4c 100644--- a/saleor/graphql/checkout/mutations/order_create_from_checkout.py+++ b/saleor/graphql/checkout/mutations/order_create_from_checkout.py@@ -7,12 +7,14 @@ from ....checkout.fetch import fetch_checkout_info, fetch_checkout_linesfrom ....core.exceptions import GiftCardNotApplicable, InsufficientStockfrom ....discount.models import NotApplicablefrom ....permission.enums import CheckoutPermissions+from ....webhook.event_types import WebhookEventAsyncType, WebhookEventSyncTypefrom ...app.dataloaders import get_app_promisefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_32, ADDED_IN_38from ...core.doc_category import DOC_CATEGORY_ORDERSfrom ...core.mutations import BaseMutationfrom ...core.types import Error, NonNullList+from ...core.utils import CHECKOUT_CALCULATE_TAXES_MESSAGE, WebhookEventInfofrom ...meta.inputs import MetadataInputfrom ...order.types import Orderfrom ...plugins.dataloaders import get_plugin_manager_promise@@ -83,6 +85,59 @@ class OrderCreateFromCheckout(BaseMutation):error_type_class = OrderCreateFromCheckoutErrorsupport_meta_field = Truesupport_private_meta_field = True+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_CREATED,+ description="Triggered when order is created.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for order placement.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A staff notification for order placement.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_UPDATED,+ description=(+ "Triggered when order received the update after placement."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_PAID,+ description="Triggered when newly created order is paid.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_FULLY_PAID,+ description="Triggered when newly created order is fully paid.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.ORDER_CONFIRMED,+ description=(+ "Optionally triggered when newly created order are automatically "+ "marked as confirmed."+ ),+ ),+ ]@classmethoddef check_permissions(cls, context, permissions=None, **data):diff --git a/saleor/graphql/checkout/types.py b/saleor/graphql/checkout/types.pyindex 77bc3d2108..7d5ee24a62 100644--- a/saleor/graphql/checkout/types.py+++ b/saleor/graphql/checkout/types.py@@ -21,6 +21,7 @@ from ...shipping.interface import ShippingMethodDatafrom ...tax.utils import get_display_gross_pricesfrom ...warehouse import models as warehouse_modelsfrom ...warehouse.reservations import is_reservation_enabled+from ...webhook.event_types import WebhookEventSyncTypefrom ..account.dataloaders import AddressByIdLoaderfrom ..account.utils import check_is_owner_or_has_one_of_permsfrom ..channel import ChannelContext@@ -40,10 +41,11 @@ from ..core.descriptions import ()from ..core.doc_category import DOC_CATEGORY_CHECKOUT, DOC_CATEGORY_PAYMENTSfrom ..core.enums import LanguageCodeEnum+from ..core.fields import BaseFieldfrom ..core.scalars import UUIDfrom ..core.tracing import traced_resolverfrom ..core.types import BaseObjectType, ModelObjectType, Money, NonNullList, TaxedMoney-from ..core.utils import str_to_enum+from ..core.utils import CHECKOUT_CALCULATE_TAXES_MESSAGE, WebhookEventInfo, str_to_enumfrom ..decorators import one_of_permissions_requiredfrom ..giftcard.types import GiftCardfrom ..meta import resolvers as MetaResolvers@@ -142,20 +144,32 @@ class CheckoutLine(ModelObjectType[models.CheckoutLine]):required=True,description="The quantity of product variant assigned to the checkout line.",)- unit_price = graphene.Field(+ unit_price = BaseField(TaxedMoney,description="The unit price of the checkout line, with taxes and discounts.",required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)undiscounted_unit_price = graphene.Field(Money,description="The unit price of the checkout line, without discounts.",required=True,)- total_price = graphene.Field(+ total_price = BaseField(TaxedMoney,description="The sum of the checkout line price, taxes and discounts.",required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)undiscounted_total_price = graphene.Field(Money,@@ -417,16 +431,48 @@ class Checkout(ModelObjectType[models.Checkout]):voucher_code = graphene.String(description="The code of voucher assigned to the checkout.")- available_shipping_methods = NonNullList(- ShippingMethod,+ available_shipping_methods = BaseField(+ NonNullList(ShippingMethod),required=True,description="Shipping methods that can be used with this checkout.",deprecation_reason=(f"{DEPRECATED_IN_3X_FIELD} Use `shippingMethods` instead."),+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ ],)- shipping_methods = NonNullList(- ShippingMethod,+ shipping_methods = BaseField(+ NonNullList(ShippingMethod),required=True,description="Shipping methods that can be used with this checkout.",+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ ],)available_collection_points = NonNullList(Warehouse,@@ -435,10 +481,16 @@ class Checkout(ModelObjectType[models.Checkout]):"Collection points that can be used for this order." + ADDED_IN_31),)- available_payment_gateways = NonNullList(- PaymentGateway,+ available_payment_gateways = BaseField(+ NonNullList(PaymentGateway),description="List of available payment gateways.",required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.PAYMENT_LIST_GATEWAYS,+ description="Fetch payment gateways available for checkout.",+ ),+ ],)email = graphene.String(description="Email of a customer.", required=False)gift_cards = NonNullList(@@ -464,27 +516,71 @@ class Checkout(ModelObjectType[models.Checkout]):),required=True,)- shipping_price = graphene.Field(+ shipping_price = BaseField(TaxedMoney,description=("The price of the shipping, with all the taxes included. Set to 0 when no ""delivery method is selected."),required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)- shipping_method = graphene.Field(+ shipping_method = BaseField(ShippingMethod,description="The shipping method related with checkout.",deprecation_reason=(f"{DEPRECATED_IN_3X_FIELD} Use `deliveryMethod` instead."),+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ ],)- delivery_method = graphene.Field(+ delivery_method = BaseField(DeliveryMethod,description=("The delivery method selected for this checkout." + ADDED_IN_31),+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.SHIPPING_LIST_METHODS_FOR_CHECKOUT,+ description=(+ "Optionally triggered when cached external shipping methods are "+ "invalid."+ ),+ ),+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_FILTER_SHIPPING_METHODS,+ description=(+ "Optionally triggered when cached filtered shipping methods are "+ "invalid."+ ),+ ),+ ],)- subtotal_price = graphene.Field(+ subtotal_price = BaseField(TaxedMoney,description="The price of the checkout before shipping, with taxes included.",required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)tax_exemption = graphene.Boolean(description=(@@ -493,16 +589,22 @@ class Checkout(ModelObjectType[models.Checkout]):required=True,)token = graphene.Field(UUID, description="The checkout's token.", required=True)- total_price = graphene.Field(+ total_price = BaseField(TaxedMoney,description=("The sum of the the checkout line prices, with all the taxes,""shipping costs, and discounts included."),required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)- total_balance = graphene.Field(+ total_balance = BaseField(Money,description=("The difference between the paid and the checkout total amount."@@ -510,6 +612,12 @@ class Checkout(ModelObjectType[models.Checkout]):+ PREVIEW_FEATURE),required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)language_code = graphene.Field(@@ -531,17 +639,31 @@ class Checkout(ModelObjectType[models.Checkout]):),required=True,)- authorize_status = CheckoutAuthorizeStatusEnum(+ authorize_status = BaseField(+ CheckoutAuthorizeStatusEnum,description=("The authorize status of the checkout." + ADDED_IN_313 + PREVIEW_FEATURE),required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)- charge_status = CheckoutChargeStatusEnum(+ charge_status = BaseField(+ CheckoutChargeStatusEnum,description=("The charge status of the checkout." + ADDED_IN_313 + PREVIEW_FEATURE),required=True,+ webhook_events_info=[+ WebhookEventInfo(+ type=WebhookEventSyncType.CHECKOUT_CALCULATE_TAXES,+ description=CHECKOUT_CALCULATE_TAXES_MESSAGE,+ ),+ ],)class Meta:@@ -587,8 +709,8 @@ class Checkout(ModelObjectType[models.Checkout]):def resolve_email(root: models.Checkout, _info: ResolveInfo):return root.get_customer_email()- @classmethod- def resolve_shipping_method(cls, root: models.Checkout, info):+ @staticmethod+ def resolve_shipping_method(root: models.Checkout, info):def with_checkout_info(checkout_info):delivery_method = checkout_info.delivery_method_info.delivery_methodif not delivery_method or not isinstance(@@ -603,10 +725,10 @@ class Checkout(ModelObjectType[models.Checkout]):.then(with_checkout_info))- @classmethod+ @staticmethod@traced_resolver@prevent_sync_event_circular_query- def resolve_shipping_methods(cls, root: models.Checkout, info: ResolveInfo):+ def resolve_shipping_methods(root: models.Checkout, info: ResolveInfo):return (CheckoutInfoByCheckoutTokenLoader(info.context).load(root.token)@@ -903,8 +1025,8 @@ class Checkout(ModelObjectType[models.Checkout]):def resolve_updated_at(cls, root: models.Checkout, _info):return root.last_change- @classmethod- def resolve_authorize_status(cls, root: models.Checkout, info):+ @staticmethod+ def resolve_authorize_status(root: models.Checkout, info):def _resolve_authorize_status(data):address, lines, checkout_info, manager, transactions = datafetch_checkout_data(@@ -922,8 +1044,8 @@ class Checkout(ModelObjectType[models.Checkout]):)return Promise.all(dataloaders).then(_resolve_authorize_status)- @classmethod- def resolve_charge_status(cls, root: models.Checkout, info):+ @staticmethod+ def resolve_charge_status(root: models.Checkout, info):def _resolve_charge_status(data):address, lines, checkout_info, manager, transactions = datafetch_checkout_data(@@ -941,8 +1063,8 @@ class Checkout(ModelObjectType[models.Checkout]):)return Promise.all(dataloaders).then(_resolve_charge_status)- @classmethod- def resolve_total_balance(cls, root: models.Checkout, info):+ @staticmethod+ def resolve_total_balance(root: models.Checkout, info):def _calculate_total_balance_for_transactions(data):address, lines, checkout_info, manager, transactions = datataxed_total = calculations.calculate_checkout_total_with_gift_cards(diff --git a/saleor/graphql/core/fields.py b/saleor/graphql/core/fields.pyindex 1a784f8435..93f8779ebb 100644--- a/saleor/graphql/core/fields.py+++ b/saleor/graphql/core/fields.py@@ -10,18 +10,32 @@ from graphql import GraphQLErrorfrom ...permission.utils import message_one_of_permissions_requiredfrom ..decorators import one_of_permissions_requiredfrom .connection import FILTERS_NAME, FILTERSET_CLASS, WHERE_FILTERSET_CLASS, WHERE_NAME+from .utils import WebhookEventInfo, message_webhook_eventsclass BaseField(graphene.Field):+ description: Optional[str]doc_category: Optional[str]+ webhook_events_info: Optional[list[WebhookEventInfo]]def __init__(self, *args, **kwargs):+ auto_webhook_events_info_message = kwargs.pop(+ "auto_webhook_events_info_message", True+ )self.doc_category = kwargs.pop("doc_category", None)+ self.webhook_events_info = kwargs.pop("webhook_events_info", None)+super(BaseField, self).__init__(*args, **kwargs)+ if self.webhook_events_info and auto_webhook_events_info_message:+ description = self.description or ""+ description += message_webhook_events(self.webhook_events_info)+ self.description = description+def get_resolver(self, parent_resolver):resolver = self.resolver or parent_resolversetattr(resolver, "doc_category", self.doc_category)+ setattr(resolver, "webhook_events_info", self.webhook_events_info)return resolverdiff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.pyindex bcb7b24084..6d845c44c7 100644--- a/saleor/graphql/core/mutations.py+++ b/saleor/graphql/core/mutations.py@@ -61,8 +61,10 @@ from .types import (UploadError,)from .utils import (+ WebhookEventInfo,ext_ref_to_global_id_or_error,from_global_id_or_error,+ message_webhook_events,snake_to_camel_case,)from .utils.error_codes import get_error_code_from_error@@ -172,6 +174,8 @@ class BaseMutation(graphene.Mutation):errors_mapping=None,support_meta_field=False,support_private_meta_field=False,+ auto_webhook_events_message: bool = True,+ webhook_events_info: Optional[List[WebhookEventInfo]] = None,**options,):if not _meta:@@ -197,6 +201,11 @@ class BaseMutation(graphene.Mutation):permissions_msg = message_one_of_permissions_required(permissions)description = f"{description} {permissions_msg}"+ if webhook_events_info and auto_webhook_events_message:+ description += message_webhook_events(webhook_events_info)++ cls.webhook_events_info = webhook_events_info+cls.doc_category = doc_categorysuper().__init_subclass_with_meta__(diff --git a/saleor/graphql/core/types/base.py b/saleor/graphql/core/types/base.pyindex 3659b16eb7..6fa2362b41 100644--- a/saleor/graphql/core/types/base.py+++ b/saleor/graphql/core/types/base.py@@ -13,9 +13,11 @@ class BaseObjectType(ObjectType):default_resolver=None,_meta=None,doc_category=None,+ webhook_events_info=None,**options,):cls.doc_category = doc_category+ cls.webhook_events_info = webhook_events_infosuper(BaseObjectType, cls).__init_subclass_with_meta__(interfaces=interfaces,possible_types=possible_types,diff --git a/saleor/graphql/core/utils/__init__.py b/saleor/graphql/core/utils/__init__.pyindex 72309fca83..c1219941c3 100644--- a/saleor/graphql/core/utils/__init__.py+++ b/saleor/graphql/core/utils/__init__.py@@ -1,7 +1,8 @@import binasciiimport osimport secrets-from typing import Literal, Tuple, Type, Union, overload+from dataclasses import dataclass+from typing import List, Literal, Optional, Tuple, Type, Union, overloadimport graphenefrom django.core.exceptions import ValidationError@@ -10,6 +11,7 @@ from graphql.error import GraphQLErrorfrom ....plugins.const import APP_ID_PREFIXfrom ....thumbnail import FILE_NAME_MAX_LENGTH+from ....webhook.event_types import WebhookEventAsyncTypefrom ..validators import validate_if_int_or_uuid@@ -134,3 +136,24 @@ def ext_ref_to_global_id_or_error(model, external_reference):message=f"Couldn't resolve to a node: {external_reference}",code="not_found",)+++@dataclass+class WebhookEventInfo:+ type: str+ description: Optional[str] = None+++CHECKOUT_CALCULATE_TAXES_MESSAGE = (+ "Optionally triggered when checkout prices are expired."+)+++def message_webhook_events(webhook_events: List[WebhookEventInfo]) -> str:+ description = "\n\nTriggers the following webhook events:"+ for event in webhook_events:+ webhook_type = "async" if event.type in WebhookEventAsyncType.ALL else "sync"+ description += f"\n- {event.type.upper()} ({webhook_type})"+ if event.description:+ description += f": {event.description}"+ return descriptiondiff --git a/saleor/graphql/csv/mutations/export_gift_cards.py b/saleor/graphql/csv/mutations/export_gift_cards.pyindex 3c10d58588..38226411bc 100644--- a/saleor/graphql/csv/mutations/export_gift_cards.py+++ b/saleor/graphql/csv/mutations/export_gift_cards.py@@ -4,11 +4,13 @@ from ....csv import models as csv_modelsfrom ....csv.events import export_started_eventfrom ....csv.tasks import export_gift_cards_taskfrom ....permission.enums import GiftcardPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...app.dataloaders import get_app_promisefrom ...core import ResolveInfofrom ...core.descriptions import ADDED_IN_31from ...core.doc_category import DOC_CATEGORY_GIFT_CARDSfrom ...core.types import BaseInputObjectType, ExportError, NonNullList+from ...core.utils import WebhookEventInfofrom ...giftcard.filters import GiftCardFilterInputfrom ...giftcard.types import GiftCardfrom ..enums import ExportScope, FileTypeEnum@@ -44,6 +46,12 @@ class ExportGiftCards(BaseExportMutation):doc_category = DOC_CATEGORY_GIFT_CARDSpermissions = (GiftcardPermissions.MANAGE_GIFT_CARD,)error_type_class = ExportError+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for the exported file.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/csv/mutations/export_products.py b/saleor/graphql/csv/mutations/export_products.pyindex cdb88d946e..d21e09dd95 100644--- a/saleor/graphql/csv/mutations/export_products.py+++ b/saleor/graphql/csv/mutations/export_products.py@@ -4,12 +4,14 @@ from ....csv import models as csv_modelsfrom ....csv.events import export_started_eventfrom ....csv.tasks import export_products_taskfrom ....permission.enums import ProductPermissions+from ....webhook.event_types import WebhookEventAsyncTypefrom ...app.dataloaders import get_app_promisefrom ...attribute.types import Attributefrom ...channel.types import Channelfrom ...core import ResolveInfofrom ...core.doc_category import DOC_CATEGORY_PRODUCTSfrom ...core.types import BaseInputObjectType, ExportError, NonNullList+from ...core.utils import WebhookEventInfofrom ...product.filters import ProductFilterInputfrom ...product.types import Productfrom ...warehouse.types import Warehouse@@ -73,6 +75,12 @@ class ExportProducts(BaseExportMutation):permissions = (ProductPermissions.MANAGE_PRODUCTS,)error_type_class = ExportErrorerror_type_field = "export_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.NOTIFY_USER,+ description="A notification for the exported file.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/discount/mutations/bulk_mutations.py b/saleor/graphql/discount/mutations/bulk_mutations.pyindex 040519e138..37df35d8f8 100644--- a/saleor/graphql/discount/mutations/bulk_mutations.py+++ b/saleor/graphql/discount/mutations/bulk_mutations.py@@ -6,9 +6,11 @@ from ....discount import modelsfrom ....discount.utils import CATALOGUE_FIELDS, fetch_catalogue_infofrom ....permission.enums import DiscountPermissionsfrom ....product.tasks import update_products_discounted_prices_of_catalogues_task+from ....webhook.event_types import WebhookEventAsyncTypefrom ...core import ResolveInfofrom ...core.mutations import ModelBulkDeleteMutationfrom ...core.types import DiscountError, NonNullList+from ...core.utils import WebhookEventInfofrom ...plugins.dataloaders import get_plugin_manager_promisefrom ..types import Sale, Voucherfrom .utils import convert_catalogue_info_to_global_ids@@ -27,6 +29,12 @@ class SaleBulkDelete(ModelBulkDeleteMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_DELETED,+ description="A sale was deleted.",+ )+ ]@classmethoddef bulk_action(cls, info: ResolveInfo, queryset, /):@@ -66,6 +74,12 @@ class VoucherBulkDelete(ModelBulkDeleteMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_DELETED,+ description="A voucher was deleted.",+ )+ ]@classmethoddef bulk_action(cls, info: ResolveInfo, queryset, /):diff --git a/saleor/graphql/discount/mutations/sale/sale_add_catalogues.py b/saleor/graphql/discount/mutations/sale/sale_add_catalogues.pyindex 29c4fbf7bc..c2c48cc39b 100644--- a/saleor/graphql/discount/mutations/sale/sale_add_catalogues.py+++ b/saleor/graphql/discount/mutations/sale/sale_add_catalogues.py@@ -4,10 +4,12 @@ from .....core.tracing import traced_atomic_transactionfrom .....discount import modelsfrom .....discount.utils import fetch_catalogue_infofrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Salefrom ..utils import convert_catalogue_info_to_global_ids@@ -21,6 +23,12 @@ class SaleAddCatalogues(SaleBaseCatalogueMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_UPDATED,+ description="A sale was updated.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/discount/mutations/sale/sale_create.py b/saleor/graphql/discount/mutations/sale/sale_create.pyindex 176170449c..4471cc76f7 100644--- a/saleor/graphql/discount/mutations/sale/sale_create.py+++ b/saleor/graphql/discount/mutations/sale/sale_create.py@@ -10,6 +10,7 @@ from .....discount.error_codes import DiscountErrorCodefrom .....discount.utils import fetch_catalogue_infofrom .....permission.enums import DiscountPermissionsfrom .....product.tasks import update_products_discounted_prices_of_sale_task+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.descriptions import ADDED_IN_31@@ -17,6 +18,7 @@ from ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.mutations import ModelMutationfrom ....core.scalars import PositiveDecimalfrom ....core.types import BaseInputObjectType, DiscountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....core.validators import validate_end_is_after_startfrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...enums import DiscountValueTypeEnum@@ -70,6 +72,12 @@ class SaleCreate(ModelMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_CREATED,+ description="A sale was created.",+ ),+ ]@classmethoddef clean_instance(cls, info: ResolveInfo, instance):diff --git a/saleor/graphql/discount/mutations/sale/sale_delete.py b/saleor/graphql/discount/mutations/sale/sale_delete.pyindex 62aadcc113..ba23a62940 100644--- a/saleor/graphql/discount/mutations/sale/sale_delete.py+++ b/saleor/graphql/discount/mutations/sale/sale_delete.py@@ -6,9 +6,11 @@ from .....discount.utils import fetch_catalogue_infofrom .....graphql.core.mutations import ModelDeleteMutationfrom .....permission.enums import DiscountPermissionsfrom .....product.tasks import update_products_discounted_prices_of_catalogues_task+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Salefrom ..utils import convert_catalogue_info_to_global_ids@@ -25,6 +27,12 @@ class SaleDelete(ModelDeleteMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_DELETED,+ description="A sale was deleted.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/discount/mutations/sale/sale_remove_catalogues.py b/saleor/graphql/discount/mutations/sale/sale_remove_catalogues.pyindex d49e974c24..22c3125948 100644--- a/saleor/graphql/discount/mutations/sale/sale_remove_catalogues.py+++ b/saleor/graphql/discount/mutations/sale/sale_remove_catalogues.py@@ -5,9 +5,11 @@ from .....discount import modelsfrom .....discount.utils import fetch_catalogue_infofrom .....graphql.channel import ChannelContextfrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Salefrom ..utils import convert_catalogue_info_to_global_ids@@ -21,6 +23,12 @@ class SaleRemoveCatalogues(SaleBaseCatalogueMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_UPDATED,+ description="A sale was updated.",+ ),+ ]@classmethoddef perform_mutation( # type: ignore[override]diff --git a/saleor/graphql/discount/mutations/sale/sale_update.py b/saleor/graphql/discount/mutations/sale/sale_update.pyindex 9366038dda..46d6dc86e2 100644--- a/saleor/graphql/discount/mutations/sale/sale_update.py+++ b/saleor/graphql/discount/mutations/sale/sale_update.py@@ -9,10 +9,12 @@ from .....discount import modelsfrom .....discount.utils import CATALOGUE_FIELDS, fetch_catalogue_infofrom .....permission.enums import DiscountPermissionsfrom .....product.tasks import update_products_discounted_prices_of_catalogues_task+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.mutations import ModelMutationfrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Salefrom ..utils import convert_catalogue_info_to_global_ids@@ -33,6 +35,16 @@ class SaleUpdate(ModelMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_UPDATED,+ description="A sale was updated.",+ ),+ WebhookEventInfo(+ type=WebhookEventAsyncType.SALE_TOGGLE,+ description="Optionally triggered when a sale is started or stopped.",+ ),+ ]@classmethoddef perform_mutation(cls, _root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_add_catalogues.py b/saleor/graphql/discount/mutations/voucher/voucher_add_catalogues.pyindex dfddf9342c..e5e7623f36 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_add_catalogues.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_add_catalogues.py@@ -1,11 +1,13 @@import graphenefrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.descriptions import ADDED_IN_31from ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.types import BaseInputObjectType, DiscountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Voucherfrom ..sale.sale_base_discount_catalogue import BaseDiscountCatalogueMutation@@ -65,6 +67,12 @@ class VoucherAddCatalogues(VoucherBaseCatalogueMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_UPDATED,+ description="A voucher was updated.",+ )+ ]@classmethoddef perform_mutation(cls, _root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_channel_listing_update.py b/saleor/graphql/discount/mutations/voucher/voucher_channel_listing_update.pyindex a74cde3fa1..ea92a82cd9 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_channel_listing_update.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_channel_listing_update.py@@ -8,12 +8,14 @@ from .....core.tracing import traced_atomic_transactionfrom .....discount import DiscountValueType, modelsfrom .....discount.error_codes import DiscountErrorCodefrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....channel.mutations import BaseChannelListingMutationfrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.scalars import PositiveDecimalfrom ....core.types import BaseInputObjectType, DiscountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....core.validators import validate_price_precisionfrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Voucher@@ -62,6 +64,12 @@ class VoucherChannelListingUpdate(BaseChannelListingMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_UPDATED,+ description="A voucher was updated.",+ )+ ]@classmethoddef clean_discount_values_per_channel(cls, cleaned_input, voucher, error_dict):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_create.py b/saleor/graphql/discount/mutations/voucher/voucher_create.pyindex b96bab0623..1d3b3b3ed7 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_create.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_create.py@@ -5,12 +5,14 @@ from .....core.utils.promo_code import generate_promo_code, is_available_promo_cfrom .....discount import modelsfrom .....discount.error_codes import DiscountErrorCodefrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.descriptions import ADDED_IN_31from ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.mutations import ModelMutationfrom ....core.types import BaseInputObjectType, DiscountError, NonNullList+from ....core.utils import WebhookEventInfofrom ....core.validators import validate_end_is_after_startfrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...enums import DiscountValueTypeEnum, VoucherTypeEnum@@ -87,6 +89,12 @@ class VoucherCreate(ModelMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_CREATED,+ description="A voucher was created.",+ )+ ]@classmethoddef clean_input(cls, info: ResolveInfo, instance, data, **kwargs):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_delete.py b/saleor/graphql/discount/mutations/voucher/voucher_delete.pyindex 74135e6e23..3c5b23dda9 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_delete.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_delete.py@@ -3,10 +3,12 @@ import graphenefrom saleor.discount import modelsfrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....channel import ChannelContextfrom ....core import ResolveInfofrom ....core.mutations import ModelDeleteMutationfrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Voucher@@ -22,6 +24,12 @@ class VoucherDelete(ModelDeleteMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_DELETED,+ description="A voucher was deleted.",+ )+ ]@classmethoddef success_response(cls, instance):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_remove_catalogues.py b/saleor/graphql/discount/mutations/voucher/voucher_remove_catalogues.pyindex 49c369bb21..d7d60f9e45 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_remove_catalogues.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_remove_catalogues.py@@ -1,7 +1,9 @@from .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.doc_category import DOC_CATEGORY_DISCOUNTSfrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Voucherfrom .voucher_add_catalogues import VoucherBaseCatalogueMutation@@ -14,6 +16,12 @@ class VoucherRemoveCatalogues(VoucherBaseCatalogueMutation):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_UPDATED,+ description="A voucher was updated.",+ )+ ]@classmethoddef perform_mutation(cls, _root, info: ResolveInfo, /, **data):diff --git a/saleor/graphql/discount/mutations/voucher/voucher_update.py b/saleor/graphql/discount/mutations/voucher/voucher_update.pyindex 2ca1425cdd..ef550f4034 100644--- a/saleor/graphql/discount/mutations/voucher/voucher_update.py+++ b/saleor/graphql/discount/mutations/voucher/voucher_update.py@@ -2,8 +2,10 @@ import graphenefrom .....discount import modelsfrom .....permission.enums import DiscountPermissions+from .....webhook.event_types import WebhookEventAsyncTypefrom ....core import ResolveInfofrom ....core.types import DiscountError+from ....core.utils import WebhookEventInfofrom ....plugins.dataloaders import get_plugin_manager_promisefrom ...types import Voucherfrom .voucher_create import VoucherCreate, VoucherInput@@ -23,6 +25,12 @@ class VoucherUpdate(VoucherCreate):permissions = (DiscountPermissions.MANAGE_DISCOUNTS,)error_type_class = DiscountErrorerror_type_field = "discount_errors"+ webhook_events_info = [+ WebhookEventInfo(+ type=WebhookEventAsyncType.VOUCHER_UPDATED,+ description="A voucher was updated.",+ )+ ]@classmethoddef post_save_action(cls, info: ResolveInfo, instance, cleaned_input):diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex ab2f191604..f10fae0b13 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -10,6 +10,15 @@ directive @doc(category: String!) on ENUM | FIELD | FIELD_DEFINITION | INPUT_OBJECT | OBJECT+"""Webhook events triggered by a specific location."""+directive @webhookEventsInfo(+ """List of asynchronous webhook events triggered by a specific location."""+ asyncEvents: [WebhookEventTypeAsyncEnum!]!++ """List of synchronous webhook events triggered by a specific location."""+ syncEvents: [WebhookEventTypeSyncEnum!]!+) on FIELD | FIELD_DEFINITION | INPUT_OBJECT | OBJECT+type Query {"""Look up a webhook by ID. Requires one of the following permissions: MANAGE_APPS, OWNER.@@ -9731,11 +9740,23 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {"""The code of voucher assigned to the checkout."""voucherCode: String- """Shipping methods that can be used with this checkout."""- availableShippingMethods: [ShippingMethod!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead.")+ """+ Shipping methods that can be used with this checkout.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+ """+ availableShippingMethods: [ShippingMethod!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `shippingMethods` instead.")- """Shipping methods that can be used with this checkout."""- shippingMethods: [ShippingMethod!]!+ """+ Shipping methods that can be used with this checkout.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+ """+ shippingMethods: [ShippingMethod!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS])"""Collection points that can be used for this order.@@ -9744,8 +9765,13 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {"""availableCollectionPoints: [Warehouse!]!- """List of available payment gateways."""- availablePaymentGateways: [PaymentGateway!]!+ """+ List of available payment gateways.++ Triggers the following webhook events:+ - PAYMENT_LIST_GATEWAYS (sync): Fetch payment gateways available for checkout.+ """+ availablePaymentGateways: [PaymentGateway!]! @webhookEventsInfo(asyncEvents: [], syncEvents: [PAYMENT_LIST_GATEWAYS])"""Email of a customer."""email: String@@ -9773,21 +9799,39 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {"""The price of the shipping, with all the taxes included. Set to 0 when no delivery method is selected.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired."""- shippingPrice: TaxedMoney!+ shippingPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])- """The shipping method related with checkout."""- shippingMethod: ShippingMethod @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.")+ """+ The shipping method related with checkout.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+ """+ shippingMethod: ShippingMethod @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `deliveryMethod` instead.")"""The delivery method selected for this checkout.Added in Saleor 3.1.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid."""- deliveryMethod: DeliveryMethod+ deliveryMethod: DeliveryMethod @webhookEventsInfo(asyncEvents: [], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS])- """The price of the checkout before shipping, with taxes included."""- subtotalPrice: TaxedMoney!+ """+ The price of the checkout before shipping, with taxes included.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+ """+ subtotalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""Returns True if checkout has to be exempt from taxes.@@ -9801,8 +9845,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {"""The sum of the the checkout line prices, with all the taxes,shipping costs, and discounts included.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired."""- totalPrice: TaxedMoney!+ totalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""The difference between the paid and the checkout total amount.@@ -9810,8 +9857,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {Added in Saleor 3.13.Note: this API is currently in Feature Preview and can be subject to changes at later point.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired."""- totalBalance: Money!+ totalBalance: Money! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""Checkout language code."""languageCode: LanguageCodeEnum!@@ -9838,8 +9888,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {Added in Saleor 3.13.Note: this API is currently in Feature Preview and can be subject to changes at later point.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired."""- authorizeStatus: CheckoutAuthorizeStatusEnum!+ authorizeStatus: CheckoutAuthorizeStatusEnum! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""The charge status of the checkout.@@ -9847,8 +9900,11 @@ type Checkout implements Node & ObjectWithMetadata @doc(category: "Checkout") {Added in Saleor 3.13.Note: this API is currently in Feature Preview and can be subject to changes at later point.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired."""- chargeStatus: CheckoutChargeStatusEnum!+ chargeStatus: CheckoutChargeStatusEnum! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])}"""@@ -10170,14 +10226,24 @@ type CheckoutLine implements Node & ObjectWithMetadata @doc(category: "Checkout""""The quantity of product variant assigned to the checkout line."""quantity: Int!- """The unit price of the checkout line, with taxes and discounts."""- unitPrice: TaxedMoney!+ """+ The unit price of the checkout line, with taxes and discounts.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+ """+ unitPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""The unit price of the checkout line, without discounts."""undiscountedUnitPrice: Money!- """The sum of the checkout line price, taxes and discounts."""- totalPrice: TaxedMoney!+ """+ The sum of the checkout line price, taxes and discounts.++ Triggers the following webhook events:+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+ """+ totalPrice: TaxedMoney! @webhookEventsInfo(asyncEvents: [], syncEvents: [CHECKOUT_CALCULATE_TAXES])"""The sum of the checkout line price, without discounts."""undiscountedTotalPrice: Money!@@ -16020,36 +16086,49 @@ type Mutation {Creates a new sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_CREATED (async): A sale was created."""saleCreate("""Fields required to create a sale."""input: SaleInput!- ): SaleCreate @doc(category: "Discounts")+ ): SaleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_CREATED], syncEvents: [])"""Deletes a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_DELETED (async): A sale was deleted."""saleDelete("""ID of a sale to delete."""id: ID!- ): SaleDelete @doc(category: "Discounts")+ ): SaleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: [])"""Deletes sales.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_DELETED (async): A sale was deleted."""saleBulkDelete("""List of sale IDs to delete."""ids: [ID!]!- ): SaleBulkDelete @doc(category: "Discounts")+ ): SaleBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: [])"""Updates a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_UPDATED (async): A sale was updated.+ - SALE_TOGGLE (async): Optionally triggered when a sale is started or stopped."""saleUpdate("""ID of a sale to update."""@@ -16057,12 +16136,15 @@ type Mutation {"""Fields required to update a sale."""input: SaleInput!- ): SaleUpdate @doc(category: "Discounts")+ ): SaleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED, SALE_TOGGLE], syncEvents: [])"""Adds products, categories, collections to a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_UPDATED (async): A sale was updated."""saleCataloguesAdd("""ID of a sale."""@@ -16070,12 +16152,15 @@ type Mutation {"""Fields required to modify catalogue IDs of sale."""input: CatalogueInput!- ): SaleAddCatalogues @doc(category: "Discounts")+ ): SaleAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: [])"""Removes products, categories, collections from a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - SALE_UPDATED (async): A sale was updated."""saleCataloguesRemove("""ID of a sale."""@@ -16083,7 +16168,7 @@ type Mutation {"""Fields required to modify catalogue IDs of sale."""input: CatalogueInput!- ): SaleRemoveCatalogues @doc(category: "Discounts")+ ): SaleRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: [])"""Creates/updates translations for a sale.@@ -16116,36 +16201,48 @@ type Mutation {Creates a new voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_CREATED (async): A voucher was created."""voucherCreate("""Fields required to create a voucher."""input: VoucherInput!- ): VoucherCreate @doc(category: "Discounts")+ ): VoucherCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CREATED], syncEvents: [])"""Deletes a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_DELETED (async): A voucher was deleted."""voucherDelete("""ID of a voucher to delete."""id: ID!- ): VoucherDelete @doc(category: "Discounts")+ ): VoucherDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: [])"""Deletes vouchers.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_DELETED (async): A voucher was deleted."""voucherBulkDelete("""List of voucher IDs to delete."""ids: [ID!]!- ): VoucherBulkDelete @doc(category: "Discounts")+ ): VoucherBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: [])"""Updates a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_UPDATED (async): A voucher was updated."""voucherUpdate("""ID of a voucher to update."""@@ -16153,12 +16250,15 @@ type Mutation {"""Fields required to update a voucher."""input: VoucherInput!- ): VoucherUpdate @doc(category: "Discounts")+ ): VoucherUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: [])"""Adds products, categories, collections to a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_UPDATED (async): A voucher was updated."""voucherCataloguesAdd("""ID of a voucher."""@@ -16166,12 +16266,15 @@ type Mutation {"""Fields required to modify catalogue IDs of voucher."""input: CatalogueInput!- ): VoucherAddCatalogues @doc(category: "Discounts")+ ): VoucherAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: [])"""Removes products, categories, collections from a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_UPDATED (async): A voucher was updated."""voucherCataloguesRemove("""ID of a voucher."""@@ -16179,7 +16282,7 @@ type Mutation {"""Fields required to modify catalogue IDs of voucher."""input: CatalogueInput!- ): VoucherRemoveCatalogues @doc(category: "Discounts")+ ): VoucherRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: [])"""Creates/updates translations for a voucher.@@ -16199,6 +16302,9 @@ type Mutation {Manage voucher's availability in channels.Requires one of the following permissions: MANAGE_DISCOUNTS.++ Triggers the following webhook events:+ - VOUCHER_UPDATED (async): A voucher was updated."""voucherChannelListingUpdate("""ID of a voucher to update."""@@ -16206,17 +16312,20 @@ type Mutation {"""Fields required to update voucher channel listings."""input: VoucherChannelListingInput!- ): VoucherChannelListingUpdate @doc(category: "Discounts")+ ): VoucherChannelListingUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: [])"""Export products to csv file.Requires one of the following permissions: MANAGE_PRODUCTS.++ Triggers the following webhook events:+ - NOTIFY_USER (async): A notification for the exported file."""exportProducts("""Fields required to export product data."""input: ExportProductsInput!- ): ExportProducts @doc(category: "Products")+ ): ExportProducts @doc(category: "Products") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])"""Export gift cards to csv file.@@ -16224,11 +16333,14 @@ type Mutation {Added in Saleor 3.1.Requires one of the following permissions: MANAGE_GIFT_CARD.++ Triggers the following webhook events:+ - NOTIFY_USER (async): A notification for the exported file."""exportGiftCards("""Fields required to export gift cards data."""input: ExportGiftCardsInput!- ): ExportGiftCards @doc(category: "Gift cards")+ ): ExportGiftCards @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])"""Upload a file. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec@@ -16240,7 +16352,12 @@ type Mutation {file: Upload!): FileUpload- """Adds a gift card or a voucher to a checkout."""+ """+ Adds a gift card or a voucher to a checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutAddPromoCode("""The ID of the checkout.@@ -16265,9 +16382,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutAddPromoCode @doc(category: "Checkout")+ ): CheckoutAddPromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Update billing address in the existing checkout."""+ """+ Update billing address in the existing checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutBillingAddressUpdate("""The billing address of the checkout."""billingAddress: AddressInput!@@ -16299,10 +16421,22 @@ type Mutation {Added in Saleor 3.5."""validationRules: CheckoutAddressValidationRules- ): CheckoutBillingAddressUpdate @doc(category: "Checkout")+ ): CheckoutBillingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])"""Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+ - ORDER_CREATED (async): Triggered when order is created.+ - NOTIFY_USER (async): A notification for order placement.+ - NOTIFY_USER (async): A staff notification for order placement.+ - ORDER_UPDATED (async): Triggered when order received the update after placement.+ - ORDER_PAID (async): Triggered when newly created order is paid.+ - ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid.+ - ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed."""checkoutComplete("""@@ -16347,13 +16481,18 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutComplete @doc(category: "Checkout")+ ): CheckoutComplete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES])- """Create a new checkout."""+ """+ Create a new checkout.++ Triggers the following webhook events:+ - CHECKOUT_CREATED (async): A checkout was created.+ """checkoutCreate("""Fields required to create checkout."""input: CheckoutCreateInput!- ): CheckoutCreate @doc(category: "Checkout")+ ): CheckoutCreate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_CREATED], syncEvents: [])"""Create new checkout from existing order.@@ -16371,6 +16510,9 @@ type Mutation {Sets the customer as the owner of the checkout.Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated."""checkoutCustomerAttach("""@@ -16398,12 +16540,15 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutCustomerAttach @doc(category: "Checkout")+ ): CheckoutCustomerAttach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])"""Removes the user assigned as the owner of the checkout.Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated."""checkoutCustomerDetach("""@@ -16426,9 +16571,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutCustomerDetach @doc(category: "Checkout")+ ): CheckoutCustomerDetach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Updates email address in the existing checkout object."""+ """+ Updates email address in the existing checkout object.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutEmailUpdate("""The ID of the checkout.@@ -16453,9 +16603,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutEmailUpdate @doc(category: "Checkout")+ ): CheckoutEmailUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Deletes a CheckoutLine."""+ """+ Deletes a CheckoutLine.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutLineDelete("""The ID of the checkout.@@ -16480,9 +16635,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutLineDelete @doc(category: "Checkout") @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead.")+ ): CheckoutLineDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutLinesDelete` instead.")- """Deletes checkout lines."""+ """+ Deletes checkout lines.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutLinesDelete("""The checkout's ID.@@ -16500,10 +16660,13 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutLinesDelete @doc(category: "Checkout")+ ): CheckoutLinesDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])"""Adds a checkout line to the existing checkout.If line was already in checkout, its quantity will be increased.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated."""checkoutLinesAdd("""@@ -16531,9 +16694,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutLinesAdd @doc(category: "Checkout")+ ): CheckoutLinesAdd @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Updates checkout line in the existing checkout."""+ """+ Updates checkout line in the existing checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutLinesUpdate("""The ID of the checkout.@@ -16560,9 +16728,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutLinesUpdate @doc(category: "Checkout")+ ): CheckoutLinesUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Remove a gift card or a voucher from a checkout."""+ """+ Remove a gift card or a voucher from a checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutRemovePromoCode("""The ID of the checkout.@@ -16590,7 +16763,7 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutRemovePromoCode @doc(category: "Checkout")+ ): CheckoutRemovePromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])"""Create a new payment for given checkout."""checkoutPaymentCreate(@@ -16619,7 +16792,12 @@ type Mutation {token: UUID): CheckoutPaymentCreate @doc(category: "Checkout")- """Update shipping address in the existing checkout."""+ """+ Update shipping address in the existing checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutShippingAddressUpdate("""The ID of the checkout.@@ -16651,9 +16829,15 @@ type Mutation {Added in Saleor 3.5."""validationRules: CheckoutAddressValidationRules- ): CheckoutShippingAddressUpdate @doc(category: "Checkout")+ ): CheckoutShippingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])- """Updates the shipping method of the checkout."""+ """+ Updates the shipping method of the checkout.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one.+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutShippingMethodUpdate("""The ID of the checkout.@@ -16678,12 +16862,16 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.")+ ): CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) @deprecated(reason: "This field will be removed in Saleor 4.0. Use `checkoutDeliveryMethodUpdate` instead.")"""Updates the delivery method (shipping method or pick up point) of the checkout.Added in Saleor 3.1.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one.+ - CHECKOUT_UPDATED (async): A checkout was updated."""checkoutDeliveryMethodUpdate("""Delivery Method ID (`Warehouse` ID or `ShippingMethod` ID)."""@@ -16702,9 +16890,14 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout")+ ): CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT])- """Update language code in the existing checkout."""+ """+ Update language code in the existing checkout.++ Triggers the following webhook events:+ - CHECKOUT_UPDATED (async): A checkout was updated.+ """checkoutLanguageCodeUpdate("""The ID of the checkout.@@ -16729,12 +16922,24 @@ type Mutation {DEPRECATED: this field will be removed in Saleor 4.0. Use `id` instead."""token: UUID- ): CheckoutLanguageCodeUpdate @doc(category: "Checkout")+ ): CheckoutLanguageCodeUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [])"""Create new order from existing checkout. Requires the following permissions: AUTHENTICATED_APP and HANDLE_CHECKOUTS.Added in Saleor 3.2.++ Triggers the following webhook events:+ - SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+ - CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+ - CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+ - ORDER_CREATED (async): Triggered when order is created.+ - NOTIFY_USER (async): A notification for order placement.+ - NOTIFY_USER (async): A staff notification for order placement.+ - ORDER_UPDATED (async): Triggered when order received the update after placement.+ - ORDER_PAID (async): Triggered when newly created order is paid.+ - ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid.+ - ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed."""orderCreateFromCheckout("""ID of a checkout that will be converted to an order."""@@ -16758,23 +16963,29 @@ type Mutation {Determines if checkout should be removed after creating an order. Default true."""removeCheckout: Boolean = true- ): OrderCreateFromCheckout @doc(category: "Orders")+ ): OrderCreateFromCheckout @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES])"""Creates new channel.Requires one of the following permissions: MANAGE_CHANNELS.++ Triggers the following webhook events:+ - CHANNEL_CREATED (async): A channel was created."""channelCreate("""Fields required to create channel."""input: ChannelCreateInput!- ): ChannelCreate @doc(category: "Channels")+ ): ChannelCreate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_CREATED], syncEvents: [])"""Update a channel.Requires one of the following permissions: MANAGE_CHANNELS.Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS.++ Triggers the following webhook events:+ - CHANNEL_UPDATED (async): A channel was updated."""channelUpdate("""ID of a channel to update."""@@ -16782,12 +16993,15 @@ type Mutation {"""Fields required to update a channel."""input: ChannelUpdateInput!- ): ChannelUpdate @doc(category: "Channels")+ ): ChannelUpdate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_UPDATED], syncEvents: [])"""Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed.Requires one of the following permissions: MANAGE_CHANNELS.++ Triggers the following webhook events:+ - CHANNEL_DELETED (async): A channel was deleted."""channelDelete("""ID of a channel to delete."""@@ -16795,27 +17009,33 @@ type Mutation {"""Fields required to delete a channel."""input: ChannelDeleteInput- ): ChannelDelete @doc(category: "Channels")+ ): ChannelDelete @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_DELETED], syncEvents: [])"""Activate a channel.Requires one of the following permissions: MANAGE_CHANNELS.++ Triggers the following webhook events:+ - CHANNEL_STATUS_CHANGED (async): A channel was activated."""channelActivate("""ID of the channel to activate."""id: ID!- ): ChannelActivate @doc(category: "Channels")+ ): ChannelActivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: [])"""Deactivate a channel.Requires one of the following permissions: MANAGE_CHANNELS.++ Triggers the following webhook events:+ - CHANNEL_STATUS_CHANGED (async): A channel was deactivated."""channelDeactivate("""ID of the channel to deactivate."""id: ID!- ): ChannelDeactivate @doc(category: "Channels")+ ): ChannelDeactivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: [])"""Reorder the warehouses of a channel.@@ -16832,16 +17052,24 @@ type Mutation {moves: [ReorderInput!]!): ChannelReorderWarehouses @doc(category: "Channels")- """Creates an attribute."""+ """+ Creates an attribute.++ Triggers the following webhook events:+ - ATTRIBUTE_CREATED (async): An attribute was created.+ """attributeCreate("""Fields required to create an attribute."""input: AttributeCreateInput!- ): AttributeCreate @doc(category: "Attributes")+ ): AttributeCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: [])"""Deletes an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_DELETED (async): An attribute was deleted."""attributeDelete("""@@ -16853,12 +17081,15 @@ type Mutation {"""ID of an attribute to delete."""id: ID- ): AttributeDelete @doc(category: "Attributes")+ ): AttributeDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: [])"""Updates attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeUpdate("""@@ -16873,7 +17104,7 @@ type Mutation {"""Fields required to update an attribute."""input: AttributeUpdateInput!- ): AttributeUpdate @doc(category: "Attributes")+ ): AttributeUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED], syncEvents: [])"""Creates/updates translations for an attribute.@@ -16910,26 +17141,37 @@ type Mutation {Deletes attributes.Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_DELETED (async): An attribute was deleted."""attributeBulkDelete("""List of attribute IDs to delete."""ids: [ID!]!- ): AttributeBulkDelete @doc(category: "Attributes")+ ): AttributeBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: [])"""Deletes values of attributes.Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted.+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeValueBulkDelete("""List of attribute value IDs to delete."""ids: [ID!]!- ): AttributeValueBulkDelete @doc(category: "Attributes")+ ): AttributeValueBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: [])"""Creates a value for an attribute.Requires one of the following permissions: MANAGE_PRODUCTS.++ Triggers the following webhook events:+ - ATTRIBUTE_VALUE_CREATED (async): An attribute value was created.+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeValueCreate("""Attribute to which value will be assigned."""@@ -16937,12 +17179,16 @@ type Mutation {"""Fields required to create an AttributeValue."""input: AttributeValueCreateInput!- ): AttributeValueCreate @doc(category: "Attributes")+ ): AttributeValueCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_UPDATED], syncEvents: [])"""Deletes a value of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted.+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeValueDelete("""@@ -16954,12 +17200,16 @@ type Mutation {"""ID of a value to delete."""id: ID- ): AttributeValueDelete @doc(category: "Attributes")+ ): AttributeValueDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: [])"""Updates value of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated.+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeValueUpdate("""@@ -16974,7 +17224,7 @@ type Mutation {"""Fields required to update an AttributeValue."""input: AttributeValueUpdateInput!- ): AttributeValueUpdate @doc(category: "Attributes")+ ): AttributeValueUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: [])"""Creates/updates translations for attributes values.@@ -17011,6 +17261,10 @@ type Mutation {Reorder the values of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++ Triggers the following webhook events:+ - ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated.+ - ATTRIBUTE_UPDATED (async): An attribute was updated."""attributeReorderValues("""ID of an attribute."""@@ -17018,20 +17272,26 @@ type Mutation {"""The list of reordering operations for given attribute values."""moves: [ReorderInput!]!- ): AttributeReorderValues @doc(category: "Attributes")+ ): AttributeReorderValues @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: [])"""Creates a new app. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS.++ Triggers the following webhook events:+ - APP_INSTALLED (async): An app was installed."""appCreate("""Fields required to create a new app."""input: AppInput!- ): AppCreate @doc(category: "Apps")+ ): AppCreate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: [])"""Updates an existing app.Requires one of the following permissions: MANAGE_APPS.++ Triggers the following webhook events:+ - APP_UPDATED (async): An app was updated."""appUpdate("""ID of an app to update."""@@ -17039,17 +17299,20 @@ type Mutation {"""Fields required to update an existing app."""input: AppInput!- ): AppUpdate @doc(category: "Apps")+ ): AppUpdate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_UPDATED], syncEvents: [])"""Deletes an app.Requires one of the following permissions: MANAGE_APPS.++ Triggers the following webhook events:+ - APP_DELETED (async): An app was deleted."""appDelete("""ID of an app to delete."""id: ID!- ): AppDelete @doc(category: "Apps")+ ): AppDelete @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_DELETED], syncEvents: [])"""Creates a new token.@@ -17089,6 +17352,9 @@ type Mutation {Retry failed installation of new app.Requires one of the following permissions: MANAGE_APPS.++ Triggers the following webhook events:+ - APP_INSTALLED (async): An app was installed."""appRetryInstall("""Determine if app will be set active or not."""@@ -17096,7 +17362,7 @@ type Mutation {"""ID of failed installation."""id: ID!- ): AppRetryInstall @doc(category: "Apps")+ ): AppRetryInstall @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: [])"""Delete failed installation.@@ -17122,21 +17388,27 @@ type Mutation {Activate the app.Requires one of the following permissions: MANAGE_APPS.++ Triggers the following webhook events:+ - APP_STATUS_CHANGED (async): An app was activated."""appActivate("""ID of app to activate."""id: ID!- ): AppActivate @doc(category: "Apps")+ ): AppActivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: [])"""Deactivate the app.Requires one of the following permissions: MANAGE_APPS.++ Triggers the following webhook events:+ - APP_STATUS_CHANGED (async): An app was deactivated."""appDeactivate("""ID of app to deactivate."""id: ID!- ): AppDeactivate @doc(category: "Apps")+ ): AppDeactivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: [])"""Create JWT token."""tokenCreate(@@ -17225,7 +17497,12 @@ type Mutation {pluginId: String!): ExternalVerify @doc(category: "Authentication")- """Sends an email with the account password modification link."""+ """+ Sends an email with the account password modification link.++ Triggers the following webhook events:+ - NOTIFY_USER (async): A notification for password reset.+ """requestPasswordReset("""Slug of a channel which will be used for notify user. Optional when only one channel exists.@@ -17239,7 +17516,7 @@ type Mutation {URL of a view where users should be redirected to reset the password. URL in RFC 1808 format."""redirectUrl: String!- ): RequestPasswordReset @doc(category: "Users")+ ): RequestPasswordReset @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])"""Confirm user account with token sent by email during registration."""confirmAccount(@@ -17281,6 +17558,9 @@ type Mutation {Request email change of the logged in user.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - NOTIFY_USER (async): A notification for account email change."""requestEmailChange("""@@ -17298,12 +17578,16 @@ type Mutation {URL of a view where users should be redirected to update the email address. URL in RFC 1808 format."""redirectUrl: String!- ): RequestEmailChange @doc(category: "Users")+ ): RequestEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])"""Confirm the email change of the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer account was updated.+ - NOTIFY_USER (async): A notification that account email change was confirmed."""confirmEmailChange("""@@ -17313,12 +17597,16 @@ type Mutation {"""A one-time token required to change the email."""token: String!- ): ConfirmEmailChange @doc(category: "Users")+ ): ConfirmEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, NOTIFY_USER], syncEvents: [])"""Create a new address for the customer.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer account was updated.+ - ADDRESS_CREATED (async): An address was created."""accountAddressCreate("""Fields required to create address."""@@ -17328,10 +17616,13 @@ type Mutation {A type of address. If provided, the new address will be automatically assigned as the customer's default address of that type."""type: AddressTypeEnum- ): AccountAddressCreate @doc(category: "Users")+ ): AccountAddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, ADDRESS_CREATED], syncEvents: [])"""Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.++ Triggers the following webhook events:+ - ADDRESS_UPDATED (async): An address was updated."""accountAddressUpdate("""ID of the address to update."""@@ -17339,20 +17630,26 @@ type Mutation {"""Fields required to update the address."""input: AddressInput!- ): AccountAddressUpdate @doc(category: "Users")+ ): AccountAddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: [])"""Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.++ Triggers the following webhook events:+ - ADDRESS_DELETED (async): An address was deleted."""accountAddressDelete("""ID of the address to delete."""id: ID!- ): AccountAddressDelete @doc(category: "Users")+ ): AccountAddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: [])"""Sets a default address for the authenticated user.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer's address was updated."""accountSetDefaultAddress("""ID of the address to set as default."""@@ -17360,28 +17657,41 @@ type Mutation {"""The type of address."""type: AddressTypeEnum!- ): AccountSetDefaultAddress @doc(category: "Users")+ ): AccountSetDefaultAddress @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: [])- """Register a new user."""+ """+ Register a new user.++ Triggers the following webhook events:+ - CUSTOMER_CREATED (async): A new customer account was created.+ - NOTIFY_USER (async): A notification for account confirmation.+ """accountRegister("""Fields required to create a user."""input: AccountRegisterInput!- ): AccountRegister @doc(category: "Users")+ ): AccountRegister @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, NOTIFY_USER], syncEvents: [])"""Updates the account of the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer account was updated.+ - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""accountUpdate("""Fields required to update the account of the logged-in user."""input: AccountInput!- ): AccountUpdate @doc(category: "Users")+ ): AccountUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: [])"""Sends an email with the account removal link for the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++ Triggers the following webhook events:+ - NOTIFY_USER (async): A notification for account delete request."""accountRequestDeletion("""@@ -17393,7 +17703,7 @@ type Mutation {URL of a view where users should be redirected to delete their account. URL in RFC 1808 format."""redirectUrl: String!- ): AccountRequestDeletion @doc(category: "Users")+ ): AccountRequestDeletion @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: [])"""Remove user account.@@ -17411,6 +17721,9 @@ type Mutation {Creates user address.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - ADDRESS_CREATED (async): A new address was created."""addressCreate("""Fields required to create address."""@@ -17418,12 +17731,15 @@ type Mutation {"""ID of a user to create address for."""userId: ID!- ): AddressCreate @doc(category: "Users")+ ): AddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_CREATED], syncEvents: [])"""Updates an address.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - ADDRESS_UPDATED (async): An address was updated."""addressUpdate("""ID of the address to update."""@@ -17431,22 +17747,28 @@ type Mutation {"""Fields required to update the address."""input: AddressInput!- ): AddressUpdate @doc(category: "Users")+ ): AddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: [])"""Deletes an address.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - ADDRESS_DELETED (async): An address was deleted."""addressDelete("""ID of the address to delete."""id: ID!- ): AddressDelete @doc(category: "Users")+ ): AddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: [])"""Sets a default address for the given user.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer was updated."""addressSetDefault("""ID of the address."""@@ -17457,22 +17779,31 @@ type Mutation {"""ID of the user to change the address for."""userId: ID!- ): AddressSetDefault @doc(category: "Users")+ ): AddressSetDefault @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: [])"""Creates a new customer.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_CREATED (async): A new customer account was created.+ - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated.+ - NOTIFY_USER (async): A notification for setting the password."""customerCreate("""Fields required to create a customer."""input: UserCreateInput!- ): CustomerCreate @doc(category: "Users")+ ): CustomerCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, CUSTOMER_METADATA_UPDATED, NOTIFY_USER], syncEvents: [])"""Updates an existing customer.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A new customer account was updated.+ - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""customerUpdate("""@@ -17487,12 +17818,15 @@ type Mutation {"""Fields required to update a customer."""input: CustomerInput!- ): CustomerUpdate @doc(category: "Users")+ ): CustomerUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: [])"""Deletes a customer.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_DELETED (async): A customer account was deleted."""customerDelete("""@@ -17504,17 +17838,20 @@ type Mutation {"""ID of a customer to delete."""id: ID- ): CustomerDelete @doc(category: "Users")+ ): CustomerDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: [])"""Deletes customers.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_DELETED (async): A customer account was deleted."""customerBulkDelete("""List of user IDs to delete."""ids: [ID!]!- ): CustomerBulkDelete @doc(category: "Users")+ ): CustomerBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: [])"""Updates customers.@@ -17524,6 +17861,10 @@ type Mutation {Note: this API is currently in Feature Preview and can be subject to changes at later point.Requires one of the following permissions: MANAGE_USERS.++ Triggers the following webhook events:+ - CUSTOMER_UPDATED (async): A customer account was updated.+ - CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""customerBulkUpdate("""Input list of customers to update."""@@ -17531,22 +17872,29 @@ type Mutation {"""Policies of error handling. DEFAULT: REJECT_EVERYTHING"""errorPolicy: ErrorPolicyEnum- ): CustomerBulkUpdate @doc(category: "Users")+ ): CustomerBulkUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: [])"""Creates a new staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - STAFF_CREATED (async): A new staff account was created.+ - NOTIFY_USER (async): A notification for setting the password."""staffCreate("""Fields required to create a staff user."""input: StaffCreateInput!- ): StaffCreate @doc(category: "Users")+ ): StaffCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_CREATED, NOTIFY_USER], syncEvents: [])"""Updates an existing staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - STAFF_UPDATED (async): A staff account was updated."""staffUpdate("""ID of a staff user to update."""@@ -17554,27 +17902,33 @@ type Mutation {"""Fields required to update a staff user."""input: StaffUpdateInput!- ): StaffUpdate @doc(category: "Users")+ ): StaffUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_UPDATED], syncEvents: [])"""Deletes a staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - STAFF_DELETED (async): A staff account was deleted."""staffDelete("""ID of a staff user to delete."""id: ID!- ): StaffDelete @doc(category: "Users")+ ): StaffDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: [])"""Deletes staff users. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - STAFF_DELETED (async): A staff account was deleted."""staffBulkDelete("""List of user IDs to delete."""ids: [ID!]!- ): StaffBulkDelete @doc(category: "Users")+ ): StaffBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: [])"""Create a user avatar. Only for staff members. This mutation must be sent as a `multipart` request. More detailed specs of the upload format can be found here: https://github.com/jaydenseric/graphql-multipart-request-spec@@ -17610,16 +17964,22 @@ type Mutation {Create new permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - PERMISSION_GROUP_CREATED (async)"""permissionGroupCreate("""Input fields to create permission group."""input: PermissionGroupCreateInput!- ): PermissionGroupCreate @doc(category: "Users")+ ): PermissionGroupCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_CREATED], syncEvents: [])"""Update permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - PERMISSION_GROUP_UPDATED (async)"""permissionGroupUpdate("""ID of the group to update."""@@ -17627,17 +17987,20 @@ type Mutation {"""Input fields to create permission group."""input: PermissionGroupUpdateInput!- ): PermissionGroupUpdate @doc(category: "Users")+ ): PermissionGroupUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_UPDATED], syncEvents: [])"""Delete permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++ Triggers the following webhook events:+ - PERMISSION_GROUP_DELETED (async)"""permissionGroupDelete("""ID of the group to delete."""id: ID!- ): PermissionGroupDelete @doc(category: "Users")+ ): PermissionGroupDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_DELETED], syncEvents: [])}"""@@ -24508,8 +24871,11 @@ input ExternalNotificationTriggerInput {Creates a new sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_CREATED (async): A sale was created."""-type SaleCreate @doc(category: "Discounts") {+type SaleCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_CREATED], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!sale: Sale@@ -24577,8 +24943,11 @@ input SaleInput @doc(category: "Discounts") {Deletes a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_DELETED (async): A sale was deleted."""-type SaleDelete @doc(category: "Discounts") {+type SaleDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!sale: Sale@@ -24588,8 +24957,11 @@ type SaleDelete @doc(category: "Discounts") {Deletes sales.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_DELETED (async): A sale was deleted."""-type SaleBulkDelete @doc(category: "Discounts") {+type SaleBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_DELETED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24600,8 +24972,12 @@ type SaleBulkDelete @doc(category: "Discounts") {Updates a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_UPDATED (async): A sale was updated.+- SALE_TOGGLE (async): Optionally triggered when a sale is started or stopped."""-type SaleUpdate @doc(category: "Discounts") {+type SaleUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED, SALE_TOGGLE], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!sale: Sale@@ -24611,8 +24987,11 @@ type SaleUpdate @doc(category: "Discounts") {Adds products, categories, collections to a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_UPDATED (async): A sale was updated."""-type SaleAddCatalogues @doc(category: "Discounts") {+type SaleAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) {"""Sale of which catalogue IDs will be modified."""sale: SalediscountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24641,8 +25020,11 @@ input CatalogueInput @doc(category: "Discounts") {Removes products, categories, collections from a sale.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- SALE_UPDATED (async): A sale was updated."""-type SaleRemoveCatalogues @doc(category: "Discounts") {+type SaleRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [SALE_UPDATED], syncEvents: []) {"""Sale of which catalogue IDs will be modified."""sale: SalediscountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24692,8 +25074,11 @@ input SaleChannelListingAddInput @doc(category: "Discounts") {Creates a new voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_CREATED (async): A voucher was created."""-type VoucherCreate @doc(category: "Discounts") {+type VoucherCreate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_CREATED], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!voucher: Voucher@@ -24757,8 +25142,11 @@ input VoucherInput @doc(category: "Discounts") {Deletes a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_DELETED (async): A voucher was deleted."""-type VoucherDelete @doc(category: "Discounts") {+type VoucherDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!voucher: Voucher@@ -24768,8 +25156,11 @@ type VoucherDelete @doc(category: "Discounts") {Deletes vouchers.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_DELETED (async): A voucher was deleted."""-type VoucherBulkDelete @doc(category: "Discounts") {+type VoucherBulkDelete @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_DELETED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24780,8 +25171,11 @@ type VoucherBulkDelete @doc(category: "Discounts") {Updates a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_UPDATED (async): A voucher was updated."""-type VoucherUpdate @doc(category: "Discounts") {+type VoucherUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!voucher: Voucher@@ -24791,8 +25185,11 @@ type VoucherUpdate @doc(category: "Discounts") {Adds products, categories, collections to a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_UPDATED (async): A voucher was updated."""-type VoucherAddCatalogues @doc(category: "Discounts") {+type VoucherAddCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) {"""Voucher of which catalogue IDs will be modified."""voucher: VoucherdiscountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24803,8 +25200,11 @@ type VoucherAddCatalogues @doc(category: "Discounts") {Removes products, categories, collections from a voucher.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_UPDATED (async): A voucher was updated."""-type VoucherRemoveCatalogues @doc(category: "Discounts") {+type VoucherRemoveCatalogues @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) {"""Voucher of which catalogue IDs will be modified."""voucher: VoucherdiscountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24826,8 +25226,11 @@ type VoucherTranslate @doc(category: "Discounts") {Manage voucher's availability in channels.Requires one of the following permissions: MANAGE_DISCOUNTS.++Triggers the following webhook events:+- VOUCHER_UPDATED (async): A voucher was updated."""-type VoucherChannelListingUpdate @doc(category: "Discounts") {+type VoucherChannelListingUpdate @doc(category: "Discounts") @webhookEventsInfo(asyncEvents: [VOUCHER_UPDATED], syncEvents: []) {"""An updated voucher instance."""voucher: VoucherdiscountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -24857,8 +25260,11 @@ input VoucherChannelListingAddInput @doc(category: "Discounts") {Export products to csv file.Requires one of the following permissions: MANAGE_PRODUCTS.++Triggers the following webhook events:+- NOTIFY_USER (async): A notification for the exported file."""-type ExportProducts @doc(category: "Products") {+type ExportProducts @doc(category: "Products") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {"""The newly created export file job which is responsible for export data."""@@ -24957,8 +25363,11 @@ Export gift cards to csv file.Added in Saleor 3.1.Requires one of the following permissions: MANAGE_GIFT_CARD.++Triggers the following webhook events:+- NOTIFY_USER (async): A notification for the exported file."""-type ExportGiftCards @doc(category: "Gift cards") {+type ExportGiftCards @doc(category: "Gift cards") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {"""The newly created export file job which is responsible for export data."""@@ -25009,8 +25418,13 @@ enum UploadErrorCode {GRAPHQL_ERROR}-"""Adds a gift card or a voucher to a checkout."""-type CheckoutAddPromoCode @doc(category: "Checkout") {+"""+Adds a gift card or a voucher to a checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutAddPromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""The checkout with the added gift card or voucher."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25071,8 +25485,13 @@ enum CheckoutErrorCode @doc(category: "Checkout") {INACTIVE_PAYMENT}-"""Update billing address in the existing checkout."""-type CheckoutBillingAddressUpdate @doc(category: "Checkout") {+"""+Update billing address in the existing checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutBillingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25098,8 +25517,20 @@ input CheckoutAddressValidationRules @doc(category: "Checkout") {"""Completes the checkout. As a result a new order is created and a payment charge is made. This action requires a successful payment before it can be performed. In case additional confirmation step as 3D secure is required confirmationNeeded flag will be set to True and no order created until payment is confirmed with second call of this mutation.-"""-type CheckoutComplete @doc(category: "Checkout") {++Triggers the following webhook events:+- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+- CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+- ORDER_CREATED (async): Triggered when order is created.+- NOTIFY_USER (async): A notification for order placement.+- NOTIFY_USER (async): A staff notification for order placement.+- ORDER_UPDATED (async): Triggered when order received the update after placement.+- ORDER_PAID (async): Triggered when newly created order is paid.+- ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid.+- ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed.+"""+type CheckoutComplete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) {"""Placed order."""order: Order@@ -25114,8 +25545,13 @@ type CheckoutComplete @doc(category: "Checkout") {errors: [CheckoutError!]!}-"""Create a new checkout."""-type CheckoutCreate @doc(category: "Checkout") {+"""+Create a new checkout.++Triggers the following webhook events:+- CHECKOUT_CREATED (async): A checkout was created.+"""+type CheckoutCreate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_CREATED], syncEvents: []) {"""Whether the checkout was created or the current active one was returned. Refer to checkoutLinesAdd and checkoutLinesUpdate to merge a cart with an active checkout."""@@ -25263,8 +25699,11 @@ enum CheckoutCreateFromOrderErrorCode @doc(category: "Checkout") {Sets the customer as the owner of the checkout.Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated."""-type CheckoutCustomerAttach @doc(category: "Checkout") {+type CheckoutCustomerAttach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25275,32 +25714,50 @@ type CheckoutCustomerAttach @doc(category: "Checkout") {Removes the user assigned as the owner of the checkout.Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated."""-type CheckoutCustomerDetach @doc(category: "Checkout") {+type CheckoutCustomerDetach @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CheckoutError!]!}-"""Updates email address in the existing checkout object."""-type CheckoutEmailUpdate @doc(category: "Checkout") {+"""+Updates email address in the existing checkout object.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutEmailUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CheckoutError!]!}-"""Deletes a CheckoutLine."""-type CheckoutLineDelete @doc(category: "Checkout") {+"""+Deletes a CheckoutLine.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutLineDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CheckoutError!]!}-"""Deletes checkout lines."""-type CheckoutLinesDelete @doc(category: "Checkout") {+"""+Deletes checkout lines.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutLinesDelete @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: Checkouterrors: [CheckoutError!]!@@ -25308,16 +25765,24 @@ type CheckoutLinesDelete @doc(category: "Checkout") {"""Adds a checkout line to the existing checkout.If line was already in checkout, its quantity will be increased.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated."""-type CheckoutLinesAdd @doc(category: "Checkout") {+type CheckoutLinesAdd @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CheckoutError!]!}-"""Updates checkout line in the existing checkout."""-type CheckoutLinesUpdate @doc(category: "Checkout") {+"""+Updates checkout line in the existing checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutLinesUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25352,8 +25817,13 @@ input CheckoutLineUpdateInput @doc(category: "Checkout") {lineId: ID}-"""Remove a gift card or a voucher from a checkout."""-type CheckoutRemovePromoCode @doc(category: "Checkout") {+"""+Remove a gift card or a voucher from a checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutRemovePromoCode @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""The checkout with the removed gift card or voucher."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25421,16 +25891,27 @@ enum StorePaymentMethodEnum @doc(category: "Payments") {NONE}-"""Update shipping address in the existing checkout."""-type CheckoutShippingAddressUpdate @doc(category: "Checkout") {+"""+Update shipping address in the existing checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutShippingAddressUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CheckoutError!]!}-"""Updates the shipping method of the checkout."""-type CheckoutShippingMethodUpdate @doc(category: "Checkout") {+"""+Updates the shipping method of the checkout.++Triggers the following webhook events:+- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout shipping method with the external one.+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutShippingMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25441,15 +25922,24 @@ type CheckoutShippingMethodUpdate @doc(category: "Checkout") {Updates the delivery method (shipping method or pick up point) of the checkout.Added in Saleor 3.1.++Triggers the following webhook events:+- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Triggered when updating the checkout delivery method with the external one.+- CHECKOUT_UPDATED (async): A checkout was updated."""-type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") {+type CheckoutDeliveryMethodUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT]) {"""An updated checkout."""checkout: Checkouterrors: [CheckoutError!]!}-"""Update language code in the existing checkout."""-type CheckoutLanguageCodeUpdate @doc(category: "Checkout") {+"""+Update language code in the existing checkout.++Triggers the following webhook events:+- CHECKOUT_UPDATED (async): A checkout was updated.+"""+type CheckoutLanguageCodeUpdate @doc(category: "Checkout") @webhookEventsInfo(asyncEvents: [CHECKOUT_UPDATED], syncEvents: []) {"""An updated checkout."""checkout: CheckoutcheckoutErrors: [CheckoutError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25460,8 +25950,20 @@ type CheckoutLanguageCodeUpdate @doc(category: "Checkout") {Create new order from existing checkout. Requires the following permissions: AUTHENTICATED_APP and HANDLE_CHECKOUTS.Added in Saleor 3.2.-"""-type OrderCreateFromCheckout @doc(category: "Orders") {++Triggers the following webhook events:+- SHIPPING_LIST_METHODS_FOR_CHECKOUT (sync): Optionally triggered when cached external shipping methods are invalid.+- CHECKOUT_FILTER_SHIPPING_METHODS (sync): Optionally triggered when cached filtered shipping methods are invalid.+- CHECKOUT_CALCULATE_TAXES (sync): Optionally triggered when checkout prices are expired.+- ORDER_CREATED (async): Triggered when order is created.+- NOTIFY_USER (async): A notification for order placement.+- NOTIFY_USER (async): A staff notification for order placement.+- ORDER_UPDATED (async): Triggered when order received the update after placement.+- ORDER_PAID (async): Triggered when newly created order is paid.+- ORDER_FULLY_PAID (async): Triggered when newly created order is fully paid.+- ORDER_CONFIRMED (async): Optionally triggered when newly created order are automatically marked as confirmed.+"""+type OrderCreateFromCheckout @doc(category: "Orders") @webhookEventsInfo(asyncEvents: [ORDER_CREATED, NOTIFY_USER, NOTIFY_USER, ORDER_UPDATED, ORDER_PAID, ORDER_FULLY_PAID, ORDER_CONFIRMED], syncEvents: [SHIPPING_LIST_METHODS_FOR_CHECKOUT, CHECKOUT_FILTER_SHIPPING_METHODS, CHECKOUT_CALCULATE_TAXES]) {"""Placed order."""order: Ordererrors: [OrderCreateFromCheckoutError!]!@@ -25508,8 +26010,11 @@ enum OrderCreateFromCheckoutErrorCode @doc(category: "Orders") {Creates new channel.Requires one of the following permissions: MANAGE_CHANNELS.++Triggers the following webhook events:+- CHANNEL_CREATED (async): A channel was created."""-type ChannelCreate @doc(category: "Channels") {+type ChannelCreate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_CREATED], syncEvents: []) {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ChannelError!]!channel: Channel@@ -25654,8 +26159,11 @@ Update a channel.Requires one of the following permissions: MANAGE_CHANNELS.Requires one of the following permissions when updating only orderSettings field: MANAGE_CHANNELS, MANAGE_ORDERS.++Triggers the following webhook events:+- CHANNEL_UPDATED (async): A channel was updated."""-type ChannelUpdate @doc(category: "Channels") {+type ChannelUpdate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_UPDATED], syncEvents: []) {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ChannelError!]!channel: Channel@@ -25717,8 +26225,11 @@ input ChannelUpdateInput @doc(category: "Channels") {Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed.Requires one of the following permissions: MANAGE_CHANNELS.++Triggers the following webhook events:+- CHANNEL_DELETED (async): A channel was deleted."""-type ChannelDelete @doc(category: "Channels") {+type ChannelDelete @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_DELETED], syncEvents: []) {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ChannelError!]!channel: Channel@@ -25733,8 +26244,11 @@ input ChannelDeleteInput @doc(category: "Channels") {Activate a channel.Requires one of the following permissions: MANAGE_CHANNELS.++Triggers the following webhook events:+- CHANNEL_STATUS_CHANGED (async): A channel was activated."""-type ChannelActivate @doc(category: "Channels") {+type ChannelActivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) {"""Activated channel."""channel: ChannelchannelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25745,8 +26259,11 @@ type ChannelActivate @doc(category: "Channels") {Deactivate a channel.Requires one of the following permissions: MANAGE_CHANNELS.++Triggers the following webhook events:+- CHANNEL_STATUS_CHANGED (async): A channel was deactivated."""-type ChannelDeactivate @doc(category: "Channels") {+type ChannelDeactivate @doc(category: "Channels") @webhookEventsInfo(asyncEvents: [CHANNEL_STATUS_CHANGED], syncEvents: []) {"""Deactivated channel."""channel: ChannelchannelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -25766,8 +26283,13 @@ type ChannelReorderWarehouses @doc(category: "Channels") {errors: [ChannelError!]!}-"""Creates an attribute."""-type AttributeCreate @doc(category: "Attributes") {+"""+Creates an attribute.++Triggers the following webhook events:+- ATTRIBUTE_CREATED (async): An attribute was created.+"""+type AttributeCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_CREATED], syncEvents: []) {attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AttributeError!]!@@ -25902,8 +26424,11 @@ input AttributeValueCreateInput @doc(category: "Attributes") {Deletes an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_DELETED (async): An attribute was deleted."""-type AttributeDelete @doc(category: "Attributes") {+type AttributeDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) {attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AttributeError!]!attribute: Attribute@@ -25913,8 +26438,11 @@ type AttributeDelete @doc(category: "Attributes") {Updates attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeUpdate @doc(category: "Attributes") {+type AttributeUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_UPDATED], syncEvents: []) {attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AttributeError!]!@@ -26092,8 +26620,11 @@ input AttributeBulkTranslateInput @doc(category: "Attributes") {Deletes attributes.Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_DELETED (async): An attribute was deleted."""-type AttributeBulkDelete @doc(category: "Attributes") {+type AttributeBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_DELETED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26104,8 +26635,12 @@ type AttributeBulkDelete @doc(category: "Attributes") {Deletes values of attributes.Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted.+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeValueBulkDelete @doc(category: "Attributes") {+type AttributeValueBulkDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26116,8 +26651,12 @@ type AttributeValueBulkDelete @doc(category: "Attributes") {Creates a value for an attribute.Requires one of the following permissions: MANAGE_PRODUCTS.++Triggers the following webhook events:+- ATTRIBUTE_VALUE_CREATED (async): An attribute value was created.+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeValueCreate @doc(category: "Attributes") {+type AttributeValueCreate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_CREATED, ATTRIBUTE_UPDATED], syncEvents: []) {"""The updated attribute."""attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26129,8 +26668,12 @@ type AttributeValueCreate @doc(category: "Attributes") {Deletes a value of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_VALUE_DELETED (async): An attribute value was deleted.+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeValueDelete @doc(category: "Attributes") {+type AttributeValueDelete @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_DELETED, ATTRIBUTE_UPDATED], syncEvents: []) {"""The updated attribute."""attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26142,8 +26685,12 @@ type AttributeValueDelete @doc(category: "Attributes") {Updates value of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated.+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeValueUpdate @doc(category: "Attributes") {+type AttributeValueUpdate @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) {"""The updated attribute."""attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26241,8 +26788,12 @@ type AttributeValueTranslate @doc(category: "Attributes") {Reorder the values of an attribute.Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.++Triggers the following webhook events:+- ATTRIBUTE_VALUE_UPDATED (async): An attribute value was updated.+- ATTRIBUTE_UPDATED (async): An attribute was updated."""-type AttributeReorderValues @doc(category: "Attributes") {+type AttributeReorderValues @doc(category: "Attributes") @webhookEventsInfo(asyncEvents: [ATTRIBUTE_VALUE_UPDATED, ATTRIBUTE_UPDATED], syncEvents: []) {"""Attribute from which values are reordered."""attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26251,8 +26802,11 @@ type AttributeReorderValues @doc(category: "Attributes") {"""Creates a new app. Requires the following permissions: AUTHENTICATED_STAFF_USER and MANAGE_APPS.++Triggers the following webhook events:+- APP_INSTALLED (async): An app was installed."""-type AppCreate @doc(category: "Apps") {+type AppCreate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) {"""The newly created authentication token."""authToken: StringappErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26307,8 +26861,11 @@ input AppInput @doc(category: "Apps") {Updates an existing app.Requires one of the following permissions: MANAGE_APPS.++Triggers the following webhook events:+- APP_UPDATED (async): An app was updated."""-type AppUpdate @doc(category: "Apps") {+type AppUpdate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_UPDATED], syncEvents: []) {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App@@ -26318,8 +26875,11 @@ type AppUpdate @doc(category: "Apps") {Deletes an app.Requires one of the following permissions: MANAGE_APPS.++Triggers the following webhook events:+- APP_DELETED (async): An app was deleted."""-type AppDelete @doc(category: "Apps") {+type AppDelete @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_DELETED], syncEvents: []) {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App@@ -26392,8 +26952,11 @@ input AppInstallInput @doc(category: "Apps") {Retry failed installation of new app.Requires one of the following permissions: MANAGE_APPS.++Triggers the following webhook events:+- APP_INSTALLED (async): An app was installed."""-type AppRetryInstall @doc(category: "Apps") {+type AppRetryInstall @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_INSTALLED], syncEvents: []) {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!appInstallation: AppInstallation@@ -26617,8 +27180,11 @@ type AppManifestBrandLogo @doc(category: "Apps") {Activate the app.Requires one of the following permissions: MANAGE_APPS.++Triggers the following webhook events:+- APP_STATUS_CHANGED (async): An app was activated."""-type AppActivate @doc(category: "Apps") {+type AppActivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App@@ -26628,8 +27194,11 @@ type AppActivate @doc(category: "Apps") {Deactivate the app.Requires one of the following permissions: MANAGE_APPS.++Triggers the following webhook events:+- APP_STATUS_CHANGED (async): An app was deactivated."""-type AppDeactivate @doc(category: "Apps") {+type AppDeactivate @doc(category: "Apps") @webhookEventsInfo(asyncEvents: [APP_STATUS_CHANGED], syncEvents: []) {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App@@ -26815,8 +27384,13 @@ type ExternalVerify @doc(category: "Authentication") {errors: [AccountError!]!}-"""Sends an email with the account password modification link."""-type RequestPasswordReset @doc(category: "Users") {+"""+Sends an email with the account password modification link.++Triggers the following webhook events:+- NOTIFY_USER (async): A notification for password reset.+"""+type RequestPasswordReset @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!}@@ -26864,8 +27438,11 @@ type PasswordChange @doc(category: "Users") {Request email change of the logged in user.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- NOTIFY_USER (async): A notification for account email change."""-type RequestEmailChange @doc(category: "Users") {+type RequestEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {"""A user instance."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26876,8 +27453,12 @@ type RequestEmailChange @doc(category: "Users") {Confirm the email change of the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer account was updated.+- NOTIFY_USER (async): A notification that account email change was confirmed."""-type ConfirmEmailChange @doc(category: "Users") {+type ConfirmEmailChange @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, NOTIFY_USER], syncEvents: []) {"""A user instance with a new email."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26888,8 +27469,12 @@ type ConfirmEmailChange @doc(category: "Users") {Create a new address for the customer.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer account was updated.+- ADDRESS_CREATED (async): An address was created."""-type AccountAddressCreate @doc(category: "Users") {+type AccountAddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, ADDRESS_CREATED], syncEvents: []) {"""A user instance for which the address was created."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26899,8 +27484,11 @@ type AccountAddressCreate @doc(category: "Users") {"""Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.++Triggers the following webhook events:+- ADDRESS_UPDATED (async): An address was updated."""-type AccountAddressUpdate @doc(category: "Users") {+type AccountAddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) {"""A user object for which the address was edited."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26910,8 +27498,11 @@ type AccountAddressUpdate @doc(category: "Users") {"""Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.++Triggers the following webhook events:+- ADDRESS_DELETED (async): An address was deleted."""-type AccountAddressDelete @doc(category: "Users") {+type AccountAddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) {"""A user instance for which the address was deleted."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26923,16 +27514,25 @@ type AccountAddressDelete @doc(category: "Users") {Sets a default address for the authenticated user.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer's address was updated."""-type AccountSetDefaultAddress @doc(category: "Users") {+type AccountSetDefaultAddress @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) {"""An updated user instance."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!}-"""Register a new user."""-type AccountRegister @doc(category: "Users") {+"""+Register a new user.++Triggers the following webhook events:+- CUSTOMER_CREATED (async): A new customer account was created.+- NOTIFY_USER (async): A notification for account confirmation.+"""+type AccountRegister @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, NOTIFY_USER], syncEvents: []) {"""Informs whether users need to confirm their email address."""requiresConfirmation: BooleanaccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -26973,8 +27573,12 @@ input AccountRegisterInput @doc(category: "Users") {Updates the account of the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer account was updated.+- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""-type AccountUpdate @doc(category: "Users") {+type AccountUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User@@ -27009,8 +27613,11 @@ input AccountInput @doc(category: "Users") {Sends an email with the account removal link for the logged-in user.Requires one of the following permissions: AUTHENTICATED_USER.++Triggers the following webhook events:+- NOTIFY_USER (async): A notification for account delete request."""-type AccountRequestDeletion @doc(category: "Users") {+type AccountRequestDeletion @doc(category: "Users") @webhookEventsInfo(asyncEvents: [NOTIFY_USER], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!}@@ -27030,8 +27637,11 @@ type AccountDelete @doc(category: "Users") {Creates user address.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- ADDRESS_CREATED (async): A new address was created."""-type AddressCreate @doc(category: "Users") {+type AddressCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_CREATED], syncEvents: []) {"""A user instance for which the address was created."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27043,8 +27653,11 @@ type AddressCreate @doc(category: "Users") {Updates an address.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- ADDRESS_UPDATED (async): An address was updated."""-type AddressUpdate @doc(category: "Users") {+type AddressUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_UPDATED], syncEvents: []) {"""A user object for which the address was edited."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27056,8 +27669,11 @@ type AddressUpdate @doc(category: "Users") {Deletes an address.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- ADDRESS_DELETED (async): An address was deleted."""-type AddressDelete @doc(category: "Users") {+type AddressDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [ADDRESS_DELETED], syncEvents: []) {"""A user instance for which the address was deleted."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27069,8 +27685,11 @@ type AddressDelete @doc(category: "Users") {Sets a default address for the given user.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer was updated."""-type AddressSetDefault @doc(category: "Users") {+type AddressSetDefault @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED], syncEvents: []) {"""An updated user instance."""user: UseraccountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27081,8 +27700,13 @@ type AddressSetDefault @doc(category: "Users") {Creates a new customer.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_CREATED (async): A new customer account was created.+- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated.+- NOTIFY_USER (async): A notification for setting the password."""-type CustomerCreate @doc(category: "Users") {+type CustomerCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_CREATED, CUSTOMER_METADATA_UPDATED, NOTIFY_USER], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User@@ -27149,8 +27773,12 @@ input UserCreateInput @doc(category: "Users") {Updates an existing customer.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A new customer account was updated.+- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""-type CustomerUpdate @doc(category: "Users") {+type CustomerUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User@@ -27207,8 +27835,11 @@ input CustomerInput @doc(category: "Users") {Deletes a customer.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_DELETED (async): A customer account was deleted."""-type CustomerDelete @doc(category: "Users") {+type CustomerDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User@@ -27218,8 +27849,11 @@ type CustomerDelete @doc(category: "Users") {Deletes customers.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_DELETED (async): A customer account was deleted."""-type CustomerBulkDelete @doc(category: "Users") {+type CustomerBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_DELETED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27234,8 +27868,12 @@ Added in Saleor 3.13.Note: this API is currently in Feature Preview and can be subject to changes at later point.Requires one of the following permissions: MANAGE_USERS.++Triggers the following webhook events:+- CUSTOMER_UPDATED (async): A customer account was updated.+- CUSTOMER_METADATA_UPDATED (async): Optionally called when customer's metadata was updated."""-type CustomerBulkUpdate @doc(category: "Users") {+type CustomerBulkUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [CUSTOMER_UPDATED, CUSTOMER_METADATA_UPDATED], syncEvents: []) {"""Returns how many objects were created."""count: Int!@@ -27292,8 +27930,12 @@ input CustomerBulkUpdateInput @doc(category: "Users") {Creates a new staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- STAFF_CREATED (async): A new staff account was created.+- NOTIFY_USER (async): A notification for setting the password."""-type StaffCreate @doc(category: "Users") {+type StaffCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_CREATED, NOTIFY_USER], syncEvents: []) {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!user: User@@ -27368,8 +28010,11 @@ input StaffCreateInput @doc(category: "Users") {Updates an existing staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- STAFF_UPDATED (async): A staff account was updated."""-type StaffUpdate @doc(category: "Users") {+type StaffUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_UPDATED], syncEvents: []) {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!user: User@@ -27417,8 +28062,11 @@ input StaffUpdateInput @doc(category: "Users") {Deletes a staff user. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- STAFF_DELETED (async): A staff account was deleted."""-type StaffDelete @doc(category: "Users") {+type StaffDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!user: User@@ -27428,8 +28076,11 @@ type StaffDelete @doc(category: "Users") {Deletes staff users. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- STAFF_DELETED (async): A staff account was deleted."""-type StaffBulkDelete @doc(category: "Users") {+type StaffBulkDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [STAFF_DELETED], syncEvents: []) {"""Returns how many objects were affected."""count: Int!staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -27476,8 +28127,11 @@ type UserBulkSetActive @doc(category: "Users") {Create new permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- PERMISSION_GROUP_CREATED (async)"""-type PermissionGroupCreate @doc(category: "Users") {+type PermissionGroupCreate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_CREATED], syncEvents: []) {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!group: Group@@ -27551,8 +28205,11 @@ input PermissionGroupCreateInput @doc(category: "Users") {Update permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- PERMISSION_GROUP_UPDATED (async)"""-type PermissionGroupUpdate @doc(category: "Users") {+type PermissionGroupUpdate @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_UPDATED], syncEvents: []) {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!group: Group@@ -27606,8 +28263,11 @@ input PermissionGroupUpdateInput @doc(category: "Users") {Delete permission group. Apps are not allowed to perform this mutation.Requires one of the following permissions: MANAGE_STAFF.++Triggers the following webhook events:+- PERMISSION_GROUP_DELETED (async)"""-type PermissionGroupDelete @doc(category: "Users") {+type PermissionGroupDelete @doc(category: "Users") @webhookEventsInfo(asyncEvents: [PERMISSION_GROUP_DELETED], syncEvents: []) {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!group: Groupdiff --git a/saleor/graphql/schema_printer.py b/saleor/graphql/schema_printer.pyindex b72b9b6851..24f375dc7f 100644--- a/saleor/graphql/schema_printer.py+++ b/saleor/graphql/schema_printer.py@@ -24,6 +24,8 @@ from graphql.utils.ast_from_value import ast_from_value__all__ = ["print_schema", "print_introspection_schema", "print_type"]+from ..webhook.event_types import WebhookEventAsyncType, WebhookEventSyncType+def is_specified_directive(directive: GraphQLDirective) -> bool:return directive.name in ("skip", "include", "deprecated")@@ -118,12 +120,39 @@ def is_schema_of_common_names(schema: GraphQLSchema) -> bool:return not subscription_type or subscription_type.name == "Subscription"-def print_object_directives(type_) -> str:+def print_object_directives_for_category(type_) -> str:doc_category = getattr(type_.graphene_type, "doc_category", None)return f' @doc(category: "{doc_category}")' if doc_category else ""-def print_field_directives(field, name) -> str:+def print_object_directvie_for_webhook_events_info(type_) -> str:+ webhook_events_info = getattr(type_.graphene_type, "webhook_events_info", None)++ if not webhook_events_info:+ return ""++ async_events = []+ sync_events = []+ for event in webhook_events_info:+ if event.type in WebhookEventAsyncType.ALL:+ async_events.append(event.type.upper())+ if event.type in WebhookEventSyncType.ALL:+ sync_events.append(event.type.upper())+ async_events_str = ", ".join(async_events)+ sync_events_str = ", ".join(sync_events)+ return (+ f" @webhookEventsInfo(asyncEvents: [{async_events_str}], syncEvents: "+ f"[{sync_events_str}])"+ )+++def print_object_directives(type_) -> str:+ directive = print_object_directives_for_category(type_)+ directive += print_object_directvie_for_webhook_events_info(type_)+ return directive+++def print_field_directives_for_category(field, name) -> str:# Get doc_category for `type Query` fields.doc_category = getattr(field.resolver, "doc_category", None)@@ -134,6 +163,41 @@ def print_field_directives(field, name) -> str:return f' @doc(category: "{doc_category}")' if doc_category else ""+def print_field_directives_for_webhook_events_info(field, name) -> str:+ webhook_events_info = getattr(field.resolver, "webhook_events_info", None)++ if not webhook_events_info and hasattr(field.type, "graphene_type"):+ webhook_events_info = getattr(+ field.type.graphene_type, "webhook_events_info", None+ )++ if not webhook_events_info:+ return ""++ async_events = []+ sync_events = []+ for event in webhook_events_info:+ if event.type in WebhookEventAsyncType.ALL:+ async_events.append(event.type.upper())+ if event.type in WebhookEventSyncType.ALL:+ sync_events.append(event.type.upper())+ async_events_str = ", ".join(async_events)+ sync_events_str = ", ".join(sync_events)++ return (+ f" @webhookEventsInfo(asyncEvents: [{async_events_str}], syncEvents: "+ f"[{sync_events_str}])"+ )+++def print_field_directives(field, name, include_doc_category: bool = True) -> str:+ directive = ""+ if include_doc_category:+ directive = print_field_directives_for_category(field, name)+ directive += print_field_directives_for_webhook_events_info(field, name)+ return directive++def print_type(type_: GraphQLNamedType) -> str:if isinstance(type_, GraphQLScalarType):type_ = type_@@ -168,13 +232,13 @@ def print_implemented_interfaces(type_: GraphQLObjectType) -> str:def print_object(type_: GrapheneObjectType) -> str:- include_field_directives = type_.name in ["Mutation", "Query"]+ include_doc_category_directives = type_.name in ["Mutation", "Query"]return (print_description(type_)+ f"type {type_.name}"+ print_implemented_interfaces(type_)+ print_object_directives(type_)- + print_fields(type_, include_field_directives)+ + print_fields(type_, include_doc_category_directives))@@ -218,14 +282,14 @@ def print_input_object(type_: GraphQLInputObjectType) -> str:def print_fields(type_: Union[GraphQLObjectType, GraphQLInterfaceType],- include_field_directives: bool = True,+ include_doc_category_directives: bool = True,) -> str:fields = [print_description(field, " ", not i)+ f" {name}"+ print_args(field.args, " ")+ f": {field.type}"- + (print_field_directives(field, name) if include_field_directives else "")+ + print_field_directives(field, name, include_doc_category_directives)+ print_deprecated(field.deprecation_reason)for i, (name, field) in enumerate(type_.fields.items())]