Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Better permissions (#9363)
Marcin Gębalaab45ebda5a14
diff --git a/saleor/core/permissions.py b/saleor/core/permissions.pyindex 721bd4fad4..0eb6953ad3 100644--- a/saleor/core/permissions.py+++ b/saleor/core/permissions.py@@ -99,6 +99,45 @@ PERMISSIONS_ENUMS = []+def is_app(context):+ return bool(context.app)+++def is_user(context):+ return context.user.is_active and context.user.is_authenticated+++def is_staff_user(context):+ return is_user(context) and context.user.is_staff+++class AuthorizationFilters(BasePermissionEnum):+ # Grants access to any authenticated app.+ AUTHENTICATED_APP = "authorization_filters.authenticated_app"++ # Grants access to any authenticated staff user.+ AUTHENTICATED_STAFF_USER = "authorization_filters.authenticated_staff_user"++ # Grants access to any authenticated user.+ AUTHENTICATED_USER = "authorization_filters.authenticated_user"++ # Grants access to the owner of the related object. This rule doesn't come with any+ # permission function, as the ownership needs to be defined individually in each+ # case.+ OWNER = "authorization_filters.owner"+++AUTHORIZATION_FILTER_MAP = {+ AuthorizationFilters.AUTHENTICATED_APP: is_app,+ AuthorizationFilters.AUTHENTICATED_USER: is_user,+ AuthorizationFilters.AUTHENTICATED_STAFF_USER: is_staff_user,+}+++def resolve_authorization_filter_fn(perm):+ return AUTHORIZATION_FILTER_MAP.get(perm)++def split_permission_codename(permissions):return [permission.split(".")[1] for permission in permissions]diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.pyindex d4a7d77919..3129f3f581 100644--- a/saleor/graphql/account/mutations/account.py+++ b/saleor/graphql/account/mutations/account.py@@ -10,6 +10,7 @@ from ....account.error_codes import AccountErrorCodefrom ....account.utils import remove_the_oldest_user_address_if_address_limit_is_reachedfrom ....checkout import AddressTypefrom ....core.jwt import create_token, jwt_decode+from ....core.permissions import AuthorizationFiltersfrom ....core.tokens import account_delete_token_generatorfrom ....core.tracing import traced_atomic_transactionfrom ....core.utils.url import validate_storefront_url@@ -176,13 +177,10 @@ class AccountUpdate(BaseCustomerCreate):exclude = ["password"]model = models.Userobject_type = User+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)error_type_class = AccountErrorerror_type_field = "account_errors"- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated-@classmethoddef perform_mutation(cls, root, info, **data):user = info.context.user@@ -210,13 +208,10 @@ class AccountRequestDeletion(BaseMutation):description = ("Sends an email with the account removal link for the logged-in user.")+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)error_type_class = AccountErrorerror_type_field = "account_errors"- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated-@classmethoddef perform_mutation(cls, root, info, **data):user = info.context.user@@ -252,10 +247,7 @@ class AccountDelete(ModelDeleteMutation):object_type = Usererror_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef clean_instance(cls, info, instance):@@ -310,10 +302,7 @@ class AccountAddressCreate(ModelMutation, I18nMixin):object_type = Addresserror_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethod@traced_atomic_transaction()@@ -346,16 +335,24 @@ class AccountAddressCreate(ModelMutation, I18nMixin):class AccountAddressUpdate(BaseAddressUpdate):class Meta:- description = "Updates an address of the logged-in user."- model = models.Address- object_type = Address+ auto_permission_message = False+ description = (+ "Updates an address of the logged-in user. Requires one of the following "+ "permissions: MANAGE_USERS, IS_OWNER."+ )error_type_class = AccountErrorerror_type_field = "account_errors"+ model = models.Address+ object_type = Addressclass AccountAddressDelete(BaseAddressDelete):class Meta:- description = "Delete an address of the logged-in user."+ auto_permission_message = False+ description = (+ "Delete an address of the logged-in user. Requires one of the following "+ "permissions: MANAGE_USERS, IS_OWNER."+ )model = models.Addressobject_type = Addresserror_type_class = AccountError@@ -375,10 +372,7 @@ class AccountSetDefaultAddress(BaseMutation):description = "Sets a default address for the authenticated user."error_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef perform_mutation(cls, _root, info, **data):@@ -431,10 +425,7 @@ class RequestEmailChange(BaseMutation):description = "Request email change of the logged in user."error_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef perform_mutation(cls, _root, info, **data):@@ -506,10 +497,7 @@ class ConfirmEmailChange(BaseMutation):description = "Confirm the email change of the logged-in user."error_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef get_token_payload(cls, token):diff --git a/saleor/graphql/account/mutations/authentication.py b/saleor/graphql/account/mutations/authentication.pyindex d1bebb14da..0fc3ae08b5 100644--- a/saleor/graphql/account/mutations/authentication.py+++ b/saleor/graphql/account/mutations/authentication.py@@ -20,7 +20,7 @@ from ....core.jwt import (get_user_from_payload,jwt_decode,)-from ....core.permissions import get_permissions_from_names+from ....core.permissions import AuthorizationFilters, get_permissions_from_namesfrom ...core.fields import JSONStringfrom ...core.mutations import BaseMutationfrom ...core.types import AccountError@@ -298,10 +298,7 @@ class DeactivateAllUserTokens(BaseMutation):description = "Deactivate all JWT tokens of the currently authenticated user."error_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef perform_mutation(cls, root, info, **data):diff --git a/saleor/graphql/account/mutations/base.py b/saleor/graphql/account/mutations/base.pyindex 8200df2909..45af35a9e2 100644--- a/saleor/graphql/account/mutations/base.py+++ b/saleor/graphql/account/mutations/base.py@@ -14,7 +14,7 @@ from ....account.search import prepare_user_search_document_valuefrom ....checkout import AddressTypefrom ....core.db.utils import set_mutation_flag_in_contextfrom ....core.exceptions import PermissionDenied-from ....core.permissions import AccountPermissions+from ....core.permissions import AccountPermissions, AuthorizationFiltersfrom ....core.tracing import traced_atomic_transactionfrom ....core.utils.url import validate_storefront_urlfrom ....giftcard.utils import assign_user_gift_cards@@ -38,7 +38,7 @@ SHIPPING_ADDRESS_FIELD = "default_shipping_address"INVALID_TOKEN = "Invalid or expired token."-def can_edit_address(context, address):+def check_can_edit_address(context, address):"""Determine whether the user or app can edit the given address.This method assumes that an address can be edited by:@@ -50,7 +50,12 @@ def can_edit_address(context, address):if requester.has_perm(AccountPermissions.MANAGE_USERS):return Trueif not context.app and not context.user.is_anonymous:- return requester.addresses.filter(pk=address.pk).exists()+ is_owner = requester.addresses.filter(pk=address.pk).exists()+ if is_owner:+ return True+ raise PermissionDenied(+ permissions=[AccountPermissions.MANAGE_USERS, AuthorizationFilters.OWNER]+ )class SetPassword(CreateToken):@@ -258,10 +263,7 @@ class PasswordChange(BaseMutation):description = "Change the password of the logged in user."error_type_class = AccountErrorerror_type_field = "account_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated+ permissions = (AuthorizationFilters.AUTHENTICATED_USER,)@classmethoddef perform_mutation(cls, _root, info, **data):@@ -309,8 +311,7 @@ class BaseAddressUpdate(ModelMutation, I18nMixin):def clean_input(cls, info, instance, data):# Method check_permissions cannot be used for permission check, because# it doesn't have the address instance.- if not can_edit_address(info.context, instance):- raise PermissionDenied()+ check_can_edit_address(info.context, instance)return super().clean_input(info, instance, data)@classmethod@@ -354,8 +355,7 @@ class BaseAddressDelete(ModelDeleteMutation):def clean_instance(cls, info, instance):# Method check_permissions cannot be used for permission check, because# it doesn't have the address instance.- if not can_edit_address(info.context, instance):- raise PermissionDenied()+ check_can_edit_address(info.context, instance)return super().clean_instance(info, instance)@classmethoddiff --git a/saleor/graphql/account/mutations/staff.py b/saleor/graphql/account/mutations/staff.pyindex 40b7d6368a..0f7f557dea 100644--- a/saleor/graphql/account/mutations/staff.py+++ b/saleor/graphql/account/mutations/staff.py@@ -15,7 +15,6 @@ from ....account.utils import (remove_the_oldest_user_address_if_address_limit_is_reached,)from ....checkout import AddressType-from ....core.exceptions import PermissionDeniedfrom ....core.permissions import AccountPermissionsfrom ....core.tracing import traced_atomic_transactionfrom ....core.utils.url import validate_storefront_url@@ -427,9 +426,6 @@ class StaffDelete(StaffDeleteMixin, UserDelete):@classmethoddef perform_mutation(cls, _root, info, **data):- if not cls.check_permissions(info.context):- raise PermissionDenied()-user_id = data.get("id")instance = cls.get_node_or_error(info, user_id, only_type=User)cls.clean_instance(info, instance)diff --git a/saleor/graphql/account/resolvers.py b/saleor/graphql/account/resolvers.pyindex c6d2d4867e..bdad41405d 100644--- a/saleor/graphql/account/resolvers.py+++ b/saleor/graphql/account/resolvers.py@@ -9,6 +9,7 @@ from ...account import modelsfrom ...core.exceptions import PermissionDeniedfrom ...core.permissions import (AccountPermissions,+ AuthorizationFilters,OrderPermissions,has_one_of_permissions,)@@ -201,12 +202,14 @@ def prepare_graphql_payment_sources_type(payment_sources):def resolve_address(info, id):user = info.context.userapp = info.context.app- _model, address_pk = from_global_id_or_error(id, Address)+ _, address_pk = from_global_id_or_error(id, Address)if app and app.has_perm(AccountPermissions.MANAGE_USERS):return models.Address.objects.filter(pk=address_pk).first()if user and not user.is_anonymous:return user.addresses.filter(id=address_pk).first()- raise PermissionDenied()+ raise PermissionDenied(+ permissions=[AccountPermissions.MANAGE_USERS, AuthorizationFilters.OWNER]+ )def resolve_addresses(info, ids):diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.pyindex 392e5092e7..ec79ef8986 100644--- a/saleor/graphql/account/types.py+++ b/saleor/graphql/account/types.py@@ -8,7 +8,12 @@ from graphene import relayfrom ...account import modelsfrom ...checkout.utils import get_user_checkoutfrom ...core.exceptions import PermissionDenied-from ...core.permissions import AccountPermissions, AppPermission, OrderPermissions+from ...core.permissions import (+ AccountPermissions,+ AppPermission,+ AuthorizationFilters,+ OrderPermissions,+)from ...core.tracing import traced_resolverfrom ...order import OrderStatusfrom ..account.utils import check_requestor_access@@ -165,7 +170,13 @@ class CustomerEvent(ModelObjectType):or user.has_perm(AccountPermissions.MANAGE_STAFF)):return root.user- raise PermissionDenied()+ raise PermissionDenied(+ permissions=[+ AccountPermissions.MANAGE_STAFF,+ AccountPermissions.MANAGE_USERS,+ AuthorizationFilters.OWNER,+ ]+ )@staticmethoddef resolve_app(root: models.CustomerEvent, info):@@ -364,11 +375,16 @@ class User(ModelObjectType):if not requester.has_perm(OrderPermissions.MANAGE_ORDERS):# allow fetch requestor orders (except drafts)if root == info.context.user:- orders = list(- filter(lambda order: order.status != OrderStatus.DRAFT, orders)- )+ orders = [+ order for order in orders if order.status != OrderStatus.DRAFT+ ]else:- raise PermissionDenied()+ raise PermissionDenied(+ permissions=[+ AuthorizationFilters.OWNER,+ OrderPermissions.MANAGE_ORDERS,+ ]+ )return create_connection_slice(orders, info, kwargs, OrderCountableConnection@@ -393,7 +409,7 @@ class User(ModelObjectType):if root == info.context.user:return resolve_payment_sources(info, root, channel_slug=channel)- raise PermissionDenied()+ raise PermissionDenied(permissions=[AuthorizationFilters.OWNER])@staticmethoddef resolve_language_code(root, _info, **_kwargs):@@ -491,7 +507,9 @@ class StaffNotificationRecipient(graphene.ObjectType):user = info.context.userif user == root.user or user.has_perm(AccountPermissions.MANAGE_STAFF):return root.user- raise PermissionDenied()+ raise PermissionDenied(+ permissions=[AccountPermissions.MANAGE_STAFF, AuthorizationFilters.OWNER]+ )@staticmethoddef resolve_email(root: models.StaffNotificationRecipient, _info):diff --git a/saleor/graphql/app/types.py b/saleor/graphql/app/types.pyindex 2e7f7d4fa1..e4409a5a7c 100644--- a/saleor/graphql/app/types.py+++ b/saleor/graphql/app/types.py@@ -5,7 +5,7 @@ import graphenefrom ...app import modelsfrom ...app.types import AppExtensionTargetfrom ...core.exceptions import PermissionDenied-from ...core.permissions import AppPermission+from ...core.permissions import AppPermission, AuthorizationFiltersfrom ..core.connection import CountableConnectionfrom ..core.descriptions import ADDED_IN_31, PREVIEW_FEATUREfrom ..core.federation import federated_entity, resolve_federation_references@@ -94,7 +94,9 @@ class AppExtension(AppManifestExtension, ModelObjectType):app_id = root.app_idif not app_id:- raise PermissionDenied()+ raise PermissionDenied(+ permissions=[AppPermission.MANAGE_APPS, AuthorizationFilters.OWNER]+ )return AppByIdLoader(info.context).load(app_id)@staticmethoddiff --git a/saleor/graphql/attribute/types.py b/saleor/graphql/attribute/types.pyindex d63ecc3d92..e532a2ad24 100644--- a/saleor/graphql/attribute/types.py+++ b/saleor/graphql/attribute/types.py@@ -4,11 +4,8 @@ from typing import castimport graphenefrom django.db.models import QuerySet-from ...attribute import AttributeEntityType, AttributeInputType, AttributeType, models-from ...core.exceptions import PermissionDenied-from ...core.permissions import PagePermissions, ProductPermissions+from ...attribute import AttributeEntityType, AttributeInputType, modelsfrom ...core.tracing import traced_resolver-from ...graphql.utils import get_user_or_app_from_contextfrom ..core.connection import (CountableConnection,create_connection_slice,@@ -71,20 +68,10 @@ class AttributeValue(ModelObjectType):@staticmethod@traced_resolverdef resolve_input_type(root: models.AttributeValue, info, *_args):- def _resolve_input_type(attribute):- requester = get_user_or_app_from_context(info.context)- if attribute.type == AttributeType.PAGE_TYPE:- if requester.has_perm(PagePermissions.MANAGE_PAGES):- return attribute.input_type- raise PermissionDenied(permissions=[PagePermissions.MANAGE_PAGES])- elif requester.has_perm(ProductPermissions.MANAGE_PRODUCTS):- return attribute.input_type- raise PermissionDenied(permissions=[ProductPermissions.MANAGE_PRODUCTS])-return (AttributesByAttributeId(info.context).load(root.attribute_id)- .then(_resolve_input_type)+ .then(lambda attribute: attribute.input_type))@staticmethoddiff --git a/saleor/graphql/checkout/mutations/checkout_customer_attach.py b/saleor/graphql/checkout/mutations/checkout_customer_attach.pyindex 69b782b8be..17a7d17035 100644--- a/saleor/graphql/checkout/mutations/checkout_customer_attach.py+++ b/saleor/graphql/checkout/mutations/checkout_customer_attach.py@@ -3,7 +3,7 @@ from django.forms import ValidationErrorfrom ....checkout.error_codes import CheckoutErrorCodefrom ....core.exceptions import PermissionDenied-from ....core.permissions import AccountPermissions+from ....core.permissions import AccountPermissions, AuthorizationFiltersfrom ...core.descriptions import DEPRECATED_IN_3X_INPUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUID@@ -37,10 +37,10 @@ class CheckoutCustomerAttach(BaseMutation):description = "Sets the customer as the owner of the checkout."error_type_class = CheckoutErrorerror_type_field = "checkout_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated or context.app+ permissions = (+ AuthorizationFilters.AUTHENTICATED_APP,+ AuthorizationFilters.AUTHENTICATED_USER,+ )@classmethoddef perform_mutation(@@ -62,7 +62,12 @@ class CheckoutCustomerAttach(BaseMutation):# Raise error when trying to attach a user to a checkout# that is already owned by another user.if checkout.user_id:- raise PermissionDenied()+ raise PermissionDenied(+ message=(+ "You cannot reassign a checkout that is already attached to a "+ "user."+ )+ )if customer_id:requestor = get_user_or_app_from_context(info.context)diff --git a/saleor/graphql/checkout/mutations/checkout_customer_detach.py b/saleor/graphql/checkout/mutations/checkout_customer_detach.pyindex 0a206ae6a8..1bf4201a45 100644--- a/saleor/graphql/checkout/mutations/checkout_customer_detach.py+++ b/saleor/graphql/checkout/mutations/checkout_customer_detach.py@@ -2,7 +2,7 @@ import graphenefrom ....checkout.error_codes import CheckoutErrorCodefrom ....core.exceptions import PermissionDenied-from ....core.permissions import AccountPermissions+from ....core.permissions import AccountPermissions, AuthorizationFiltersfrom ...core.descriptions import DEPRECATED_IN_3X_INPUTfrom ...core.mutations import BaseMutationfrom ...core.scalars import UUID@@ -29,10 +29,10 @@ class CheckoutCustomerDetach(BaseMutation):description = "Removes the user assigned as the owner of the checkout."error_type_class = CheckoutErrorerror_type_field = "checkout_errors"-- @classmethod- def check_permissions(cls, context):- return context.user.is_authenticated or context.app+ permissions = (+ AuthorizationFilters.AUTHENTICATED_APP,+ AuthorizationFilters.AUTHENTICATED_USER,+ )@classmethoddef perform_mutation(cls, _root, info, checkout_id=None, token=None):diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.pyindex 918fd141e1..8bf084d4c7 100644--- a/saleor/graphql/core/mutations.py+++ b/saleor/graphql/core/mutations.py@@ -1,5 +1,6 @@import osimport secrets+from enum import Enumfrom itertools import chainfrom typing import Iterable, Tuple, Unionfrom uuid import UUID@@ -19,9 +20,17 @@ from graphql.error import GraphQLErrorfrom ...core.db.utils import set_mutation_flag_in_contextfrom ...core.exceptions import PermissionDenied-from ...core.permissions import AccountPermissions+from ...core.permissions import (+ AccountPermissions,+ AuthorizationFilters,+ resolve_authorization_filter_fn,+)from ..decorators import staff_member_or_app_required-from ..utils import get_nodes, resolve_global_ids_to_primary_keys+from ..utils import (+ get_nodes,+ get_user_or_app_from_context,+ resolve_global_ids_to_primary_keys,+)from .descriptions import DEPRECATED_IN_3X_FIELDfrom .types import File, NonNullList, Upload, UploadErrorfrom .utils import from_global_id_or_error, snake_to_camel_case@@ -99,9 +108,22 @@ class BaseMutation(graphene.Mutation):class Meta:abstract = True+ @classmethod+ def _validate_permissions(cls, permissions):+ if not permissions:+ return+ if not isinstance(permissions, tuple):+ raise ImproperlyConfigured(+ f"Permissions should be a tuple in Meta class: {permissions}"+ )+ for p in permissions:+ if not isinstance(p, Enum):+ raise ImproperlyConfigured(f"Permission should be an enum: {p}.")+@classmethoddef __init_subclass_with_meta__(cls,+ auto_permission_message=True,description=None,permissions: Tuple = None,_meta=None,@@ -119,21 +141,25 @@ class BaseMutation(graphene.Mutation):if not error_type_class:raise ImproperlyConfigured("No error_type_class provided in Meta.")- if isinstance(permissions, str):- permissions = (permissions,)-- if permissions and not isinstance(permissions, tuple):- raise ImproperlyConfigured(- "Permissions should be a tuple or a string in Meta"- )+ cls._validate_permissions(permissions)+ _meta.auto_permission_message = auto_permission_message_meta.permissions = permissions_meta.error_type_class = error_type_class_meta.error_type_field = error_type_field_meta.errors_mapping = errors_mapping++ if permissions and auto_permission_message:+ permission_msg = ", ".join([p.name for p in permissions])+ description = (+ f"{description} Requires one of the following "+ f"permissions: {permission_msg}."+ )+super().__init_subclass_with_meta__(description=description, _meta=_meta, **options)+if error_type_field:deprecated_msg = f"{DEPRECATED_IN_3X_FIELD} Use `errors` field instead."cls._meta.fields.update(@@ -331,24 +357,48 @@ class BaseMutation(graphene.Mutation):The `context` parameter is the Context instance associated with the request."""- permissions = permissions or cls._meta.permissions- if not permissions:- return True- if context.user.has_perms(permissions):+ all_permissions = permissions or cls._meta.permissions+ if not all_permissions:return True++ authorization_filters = [+ p for p in all_permissions if isinstance(p, AuthorizationFilters)+ ]+ permissions = [+ p for p in all_permissions if not isinstance(p, AuthorizationFilters)+ ]++ granted_by_permissions = False+ granted_by_authorization_filters = False+app = getattr(context, "app", None)- if app:- # for now MANAGE_STAFF permission for app is not supported- if AccountPermissions.MANAGE_STAFF in permissions:- return False- return app.has_perms(permissions)- return False+ if app and permissions and AccountPermissions.MANAGE_STAFF in permissions:+ # `MANAGE_STAFF` permission for apps is not supported. If apps could use it+ # they could create a staff user with full access which would be a+ # permission leak issue.+ return False++ requestor = get_user_or_app_from_context(context)+ if permissions:+ granted_by_permissions = requestor.has_perms(permissions)++ if authorization_filters:+ internal_perm_checks = []+ for p in authorization_filters:+ perm_fn = resolve_authorization_filter_fn(p)+ if perm_fn:+ res = perm_fn(context)+ internal_perm_checks.append(bool(res))+ granted_by_authorization_filters = any(internal_perm_checks)++ return granted_by_permissions or granted_by_authorization_filters@classmethoddef mutate(cls, root, info, **data):set_mutation_flag_in_context(info.context)+if not cls.check_permissions(info.context):- raise PermissionDenied()+ raise PermissionDenied(permissions=cls._meta.permissions)result = info.context.plugins.perform_mutation(mutation_cls=cls, root=root, info=info, data=data@@ -576,9 +626,6 @@ class ModelDeleteMutation(ModelMutation):@classmethoddef perform_mutation(cls, _root, info, **data):"""Perform a mutation that deletes a model instance."""- if not cls.check_permissions(info.context):- raise PermissionDenied()-node_id = data.get("id")model_type = cls.get_type_for_model()instance = cls.get_node_or_error(info, node_id, only_type=model_type)@@ -692,7 +739,7 @@ class BaseBulkMutation(BaseMutation):def mutate(cls, root, info, **data):set_mutation_flag_in_context(info.context)if not cls.check_permissions(info.context):- raise PermissionDenied()+ raise PermissionDenied(permissions=cls._meta.permissions)result = info.context.plugins.perform_mutation(mutation_cls=cls, root=root, info=info, data=datadiff --git a/saleor/graphql/core/tests/test_base_mutation.py b/saleor/graphql/core/tests/test_base_mutation.pyindex d06220b0f3..43e0d0d03f 100644--- a/saleor/graphql/core/tests/test_base_mutation.py+++ b/saleor/graphql/core/tests/test_base_mutation.py@@ -359,9 +359,7 @@ def test_mutation_calls_plugin_perform_mutation_after_permission_checks(mutation_query, variables=variables, context_value=schema_context)assert len(result.errors) == 1, result.to_dict()- assert result.errors[0].message == (- "You do not have permission to perform this action"- )+ assert "You need one of the following permissions" in result.errors[0].message# When permission is not missing, the execution of the plugin should happenstaff_user.user_permissions.set([permission_manage_products])diff --git a/saleor/graphql/core/tests/test_core.py b/saleor/graphql/core/tests/test_core.pyindex 5f7aee6434..a26e5c62d6 100644--- a/saleor/graphql/core/tests/test_core.py+++ b/saleor/graphql/core/tests/test_core.py@@ -1,3 +1,4 @@+import enumimport osfrom io import BytesIOfrom unittest.mock import patch@@ -171,10 +172,19 @@ def test_filter_input():assert created.type == CreatedEnum+class TestPermission(enum.Enum):+ TEST = "test"++@patch("graphene.types.mutation.Mutation.__init_subclass_with_meta__")@pytest.mark.parametrize("should_fail,permissions_value",- ((False, "valid"), (False, ("valid",)), (True, 123)),+ (+ (False, (TestPermission.TEST,)),+ (True, TestPermission.TEST),+ (True, 123),+ (True, ("TEST",)),+ ),)def test_mutation_invalid_permission_in_meta(_mocked, should_fail, permissions_value):def _run_test():@@ -188,11 +198,9 @@ def test_mutation_invalid_permission_in_meta(_mocked, should_fail, permissions_v_run_test()return- with pytest.raises(ImproperlyConfigured) as exc:+ with pytest.raises(ImproperlyConfigured):_run_test()- assert exc.value.args[0] == "Permissions should be a tuple or a string in Meta"-@pytest.mark.parametrize("cleaned_input",diff --git a/saleor/graphql/decorators.py b/saleor/graphql/decorators.pyindex 3c91387826..353e392161 100644--- a/saleor/graphql/decorators.py+++ b/saleor/graphql/decorators.py@@ -12,6 +12,8 @@ from ..core.permissions import (ProductPermissions,ProductTypePermissions,has_one_of_permissions,+ is_app,+ is_staff_user,)from ..core.permissions import permission_required as core_permission_requiredfrom .utils import get_user_or_app_from_context@@ -83,16 +85,25 @@ def one_of_permissions_required(perms: Iterable[Enum]):def _check_staff_member(context):- if not context.user.is_active or not context.user.is_staff:- raise PermissionDenied()+ if not is_staff_user(context):+ raise PermissionDenied(+ message=(+ "You need to be authenticated as a staff member to perform this action"+ )+ )staff_member_required = account_passes_test(_check_staff_member)def _check_staff_member_or_app(context):- if not context.app and (not context.user.is_active or not context.user.is_staff):- raise PermissionDenied()+ if not (is_app(context) or is_staff_user(context)):+ raise PermissionDenied(+ message=(+ "You need to be authenticated as a staff member or an app to perform "+ "this action"+ )+ )staff_member_or_app_required = account_passes_test(_check_staff_member_or_app)diff --git a/saleor/graphql/giftcard/types.py b/saleor/graphql/giftcard/types.pyindex 3411990896..1e1476f1ae 100644--- a/saleor/graphql/giftcard/types.py+++ b/saleor/graphql/giftcard/types.py@@ -6,7 +6,12 @@ import pricesfrom ...core.anonymize import obfuscate_emailfrom ...core.exceptions import PermissionDenied-from ...core.permissions import AccountPermissions, AppPermission, GiftcardPermissions+from ...core.permissions import (+ AccountPermissions,+ AppPermission,+ AuthorizationFilters,+ GiftcardPermissions,+)from ...core.tracing import traced_resolverfrom ...giftcard import GiftCardEvents, modelsfrom ..account.dataloaders import UserByUserIdLoader@@ -105,7 +110,13 @@ class GiftCardEvent(ModelObjectType):or requester.has_perm(AccountPermissions.MANAGE_STAFF)):return event_user- return PermissionDenied()+ return PermissionDenied(+ permissions=[+ AccountPermissions.MANAGE_STAFF,+ AccountPermissions.MANAGE_USERS,+ AuthorizationFilters.OWNER,+ ]+ )if root.user_id is None:return _resolve_user(None)@@ -118,7 +129,9 @@ class GiftCardEvent(ModelObjectType):requester = get_user_or_app_from_context(info.context)if requester == app or requester.has_perm(AppPermission.MANAGE_APPS):return app- return PermissionDenied()+ return PermissionDenied(+ permissions=[AppPermission.MANAGE_APPS, AuthorizationFilters.OWNER]+ )if root.app_id is None:return _resolve_app(None)@@ -327,7 +340,12 @@ class GiftCard(ModelObjectType):) or (user and requestor == user):return root.code- return PermissionDenied()+ return PermissionDenied(+ permissions=[+ AuthorizationFilters.OWNER,+ GiftcardPermissions.MANAGE_GIFT_CARD,+ ]+ )if root.used_by_id is None:return _resolve_code(None)@@ -408,7 +426,9 @@ class GiftCard(ModelObjectType):requester = get_user_or_app_from_context(info.context)if requester == app or requester.has_perm(AppPermission.MANAGE_APPS):return app- return PermissionDenied()+ return PermissionDenied(+ permissions=[AppPermission.MANAGE_APPS, AuthorizationFilters.OWNER]+ )if root.app_id is None:return _resolve_app(None)diff --git a/saleor/graphql/meta/mutations.py b/saleor/graphql/meta/mutations.pyindex c3a5a14b51..9ecb743bce 100644--- a/saleor/graphql/meta/mutations.py+++ b/saleor/graphql/meta/mutations.py@@ -260,7 +260,10 @@ class MetadataInput(graphene.InputObjectType):class UpdateMetadata(BaseMetadataMutation):class Meta:- description = "Updates metadata of an object."+ description = (+ "Updates metadata of an object. To use it, you need to have access to the "+ "modified object."+ )permission_map = PUBLIC_META_PERMISSION_MAPerror_type_class = MetadataErrorerror_type_field = "metadata_errors"@@ -291,7 +294,10 @@ class UpdateMetadata(BaseMetadataMutation):class DeleteMetadata(BaseMetadataMutation):class Meta:- description = "Delete metadata of an object."+ description = (+ "Delete metadata of an object. To use it, you need to have access to the "+ "modified object."+ )permission_map = PUBLIC_META_PERMISSION_MAPerror_type_class = MetadataErrorerror_type_field = "metadata_errors"@@ -320,7 +326,10 @@ class DeleteMetadata(BaseMetadataMutation):class UpdatePrivateMetadata(BaseMetadataMutation):class Meta:- description = "Updates private metadata of an object."+ description = (+ "Updates private metadata of an object. To use it, you need to be an "+ "authenticated staff user or an app and have access to the modified object."+ )permission_map = PRIVATE_META_PERMISSION_MAPerror_type_class = MetadataErrorerror_type_field = "metadata_errors"@@ -350,7 +359,10 @@ class UpdatePrivateMetadata(BaseMetadataMutation):class DeletePrivateMetadata(BaseMetadataMutation):class Meta:- description = "Delete object's private metadata."+ description = (+ "Delete object's private metadata. To use it, you need to be an "+ "authenticated staff user or an app and have access to the modified object."+ )permission_map = PRIVATE_META_PERMISSION_MAPerror_type_class = MetadataErrorerror_type_field = "metadata_errors"diff --git a/saleor/graphql/meta/permissions.py b/saleor/graphql/meta/permissions.pyindex d3d0494b82..9afc380805 100644--- a/saleor/graphql/meta/permissions.py+++ b/saleor/graphql/meta/permissions.py@@ -1,6 +1,9 @@from typing import Any, List+from django.core.exceptions import ValidationError+from ...account import models as account_models+from ...account.error_codes import AccountErrorCodefrom ...attribute import AttributeTypefrom ...attribute import models as attribute_modelsfrom ...core.exceptions import PermissionDenied@@ -36,7 +39,13 @@ def public_user_permissions(info, user_pk: int) -> List[BasePermissionEnum]:"""user = account_models.User.objects.filter(pk=user_pk).first()if not user:- raise PermissionDenied()+ raise ValidationError(+ {+ "id": ValidationError(+ "Couldn't resolve user.", code=AccountErrorCode.NOT_FOUND.value+ )+ }+ )if info.context.user.pk == user.pk:return []if user.is_staff:@@ -117,7 +126,7 @@ def public_payment_permissions(info, payment_pk: int) -> List[BasePermissionEnumdef private_payment_permissions(info, _object_pk: Any) -> List[BasePermissionEnum]:if info.context.app is not None or info.context.user.is_staff:return [PaymentPermissions.HANDLE_PAYMENTS]- raise PermissionDenied()+ raise PermissionDenied(permissions=[PaymentPermissions.HANDLE_PAYMENTS])def gift_card_permissions(_info, _object_pk: Any) -> List[BasePermissionEnum]:diff --git a/saleor/graphql/meta/resolvers.py b/saleor/graphql/meta/resolvers.pyindex ba59c71526..80cb903420 100644--- a/saleor/graphql/meta/resolvers.py+++ b/saleor/graphql/meta/resolvers.py@@ -92,13 +92,13 @@ def resolve_private_metadata(root: ModelWithMetadata, info):if not get_required_permission:raise PermissionDenied()- required_permission = get_required_permission(info, item_id)+ required_permissions = get_required_permission(info, item_id)- if not required_permission:+ if not required_permissions:raise PermissionDenied()requester = get_user_or_app_from_context(info.context)- if not requester.has_perms(required_permission):+ if not requester.has_perms(required_permissions):raise PermissionDenied()return resolve_metadata(root.private_metadata)diff --git a/saleor/graphql/meta/tests/test_meta_mutations.py b/saleor/graphql/meta/tests/test_meta_mutations.pyindex d38ec4304e..0d96064ce9 100644--- a/saleor/graphql/meta/tests/test_meta_mutations.py+++ b/saleor/graphql/meta/tests/test_meta_mutations.py@@ -7,6 +7,8 @@ import pytestfrom django.core.exceptions import ValidationErrorfrom django.db import transaction+from ....account.error_codes import AccountErrorCode+from ....account.models import Userfrom ....checkout.models import Checkoutfrom ....core.error_codes import MetadataErrorCodefrom ....core.models import ModelWithMetadata@@ -198,6 +200,23 @@ def test_add_public_metadata_for_customer_as_app()+def test_change_metadata_for_non_existing_user(app_api_client, customer_user):+ # given the non-existing user ID+ last_id = User.objects.order_by("id").values_list("id", flat=True).last()+ customer_id = graphene.Node.to_global_id("User", last_id + 100)++ # when+ response = execute_update_public_metadata_for_item(+ app_api_client, [], customer_id, "User"+ )++ # then+ assert (+ response["data"]["updateMetadata"]["errors"][0]["code"]+ == AccountErrorCode.NOT_FOUND.name+ )++def test_add_multiple_public_metadata_for_customer_as_app(app_api_client, permission_manage_users, customer_user):diff --git a/saleor/graphql/notifications/mutations/external_notification_trigger.py b/saleor/graphql/notifications/mutations/external_notification_trigger.pyindex fde8bbfe81..f7aeb5d7b6 100644--- a/saleor/graphql/notifications/mutations/external_notification_trigger.py+++ b/saleor/graphql/notifications/mutations/external_notification_trigger.py@@ -95,4 +95,4 @@ class ExternalNotificationTrigger(BaseMutation):def _requestor_has_permission(cls, context, permission_type):if cls.check_permissions(context, (permission_type,)):return True- raise PermissionDenied()+ raise PermissionDenied(permissions=[permission_type])diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.pyindex 693197bf56..b8fe11c330 100644--- a/saleor/graphql/product/mutations/products.py+++ b/saleor/graphql/product/mutations/products.py@@ -10,7 +10,7 @@ from django.utils.text import slugifyfrom ....attribute import AttributeInputType, AttributeTypefrom ....attribute import models as attribute_models-from ....core.exceptions import PermissionDenied, PreorderAllocationError+from ....core.exceptions import PreorderAllocationErrorfrom ....core.permissions import ProductPermissions, ProductTypePermissionsfrom ....core.tasks import delete_product_media_taskfrom ....core.tracing import traced_atomic_transaction@@ -176,8 +176,6 @@ class CategoryDelete(ModelDeleteMutation):@classmethoddef perform_mutation(cls, _root, info, **data):- if not cls.check_permissions(info.context):- raise PermissionDenied()node_id = data.get("id")instance = cls.get_node_or_error(info, node_id, only_type=Category)diff --git a/saleor/graphql/product/tests/test_attributes.py b/saleor/graphql/product/tests/test_attributes.pyindex 5c82e060aa..851736dada 100644--- a/saleor/graphql/product/tests/test_attributes.py+++ b/saleor/graphql/product/tests/test_attributes.py@@ -1125,9 +1125,7 @@ def test_unassign_attributes_not_in_product_type(assert len(content["productType"]["variantAttributes"]) == 0-def test_retrieve_product_attributes_input_type(- staff_api_client, product, permission_manage_products, channel_USD-):+def test_retrieve_product_attributes_input_type(staff_api_client, product, channel_USD):query = """query ($channel: String){products(first: 10, channel: $channel) {@@ -1146,9 +1144,7 @@ def test_retrieve_product_attributes_input_type(variables = {"channel": channel_USD.slug}found_products = get_graphql_content(- staff_api_client.post_graphql(- query, variables, permissions=[permission_manage_products]- )+ staff_api_client.post_graphql(query, variables))["data"]["products"]["edges"]assert len(found_products) == 1diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 7b39a8d06c..595b26b275 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -7798,19 +7798,25 @@ enum StaffMemberStatus {}type Mutation {- """Creates a new webhook subscription."""+ """+ Creates a new webhook subscription. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.+ """webhookCreate("""Fields required to create a webhook."""input: WebhookCreateInput!): WebhookCreate- """Deletes a webhook subscription."""+ """+ Deletes a webhook subscription. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.+ """webhookDelete("""ID of a webhook to delete."""id: ID!): WebhookDelete- """Updates a webhook subscription."""+ """+ Updates a webhook subscription. Requires one of the following permissions: MANAGE_APPS.+ """webhookUpdate("""ID of a webhook to update."""id: ID!@@ -7819,19 +7825,25 @@ type Mutation {input: WebhookUpdateInput!): WebhookUpdate- """Retries event delivery."""+ """+ Retries event delivery. Requires one of the following permissions: MANAGE_APPS.+ """eventDeliveryRetry("""ID of the event delivery to retry."""id: ID!): EventDeliveryRetry- """Creates new warehouse."""+ """+ Creates new warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+ """createWarehouse("""Fields required to create warehouse."""input: WarehouseCreateInput!): WarehouseCreate- """Updates given warehouse."""+ """+ Updates given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+ """updateWarehouse("""ID of a warehouse to update."""id: ID!@@ -7840,13 +7852,17 @@ type Mutation {input: WarehouseUpdateInput!): WarehouseUpdate- """Deletes selected warehouse."""+ """+ Deletes selected warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+ """deleteWarehouse("""ID of a warehouse to delete."""id: ID!): WarehouseDelete- """Add shipping zone to given warehouse."""+ """+ Add shipping zone to given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+ """assignWarehouseShippingZone("""ID of a warehouse to update."""id: ID!@@ -7855,7 +7871,9 @@ type Mutation {shippingZoneIds: [ID!]!): WarehouseShippingZoneAssign- """Remove shipping zone from given warehouse."""+ """+ Remove shipping zone from given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+ """unassignWarehouseShippingZone("""ID of a warehouse to update."""id: ID!@@ -7864,13 +7882,17 @@ type Mutation {shippingZoneIds: [ID!]!): WarehouseShippingZoneUnassign- """Creates a new staff notification recipient."""+ """+ Creates a new staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+ """staffNotificationRecipientCreate("""Fields required to create a staff notification recipient."""input: StaffNotificationRecipientInput!): StaffNotificationRecipientCreate- """Updates a staff notification recipient."""+ """+ Updates a staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+ """staffNotificationRecipientUpdate("""ID of a staff notification recipient to update."""id: ID!@@ -7879,28 +7901,38 @@ type Mutation {input: StaffNotificationRecipientInput!): StaffNotificationRecipientUpdate- """Delete staff notification recipient."""+ """+ Delete staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+ """staffNotificationRecipientDelete("""ID of a staff notification recipient to delete."""id: ID!): StaffNotificationRecipientDelete- """Updates site domain of the shop."""+ """+ Updates site domain of the shop. Requires one of the following permissions: MANAGE_SETTINGS.+ """shopDomainUpdate("""Fields required to update site."""input: SiteDomainInput): ShopDomainUpdate- """Updates shop settings."""+ """+ Updates shop settings. Requires one of the following permissions: MANAGE_SETTINGS.+ """shopSettingsUpdate("""Fields required to update shop settings."""input: ShopSettingsInput!): ShopSettingsUpdate- """Fetch tax rates."""+ """+ Fetch tax rates. Requires one of the following permissions: MANAGE_SETTINGS.+ """shopFetchTaxRates: ShopFetchTaxRates- """Creates/updates translations for shop settings."""+ """+ Creates/updates translations for shop settings. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """shopSettingsTranslate("""Fields required to update shop settings translations."""input: ShopSettingsTranslationInput!@@ -7910,26 +7942,32 @@ type Mutation {): ShopSettingsTranslate"""- Update the shop's address. If the `null` value is passed, the currently selected address will be deleted.+ Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. Requires one of the following permissions: MANAGE_SETTINGS."""shopAddressUpdate("""Fields required to update shop address."""input: AddressInput): ShopAddressUpdate- """Update shop order settings."""+ """+ Update shop order settings. Requires one of the following permissions: MANAGE_ORDERS.+ """orderSettingsUpdate("""Fields required to update shop order settings."""input: OrderSettingsUpdateInput!): OrderSettingsUpdate- """Update gift card settings."""+ """+ Update gift card settings. Requires one of the following permissions: MANAGE_GIFT_CARD.+ """giftCardSettingsUpdate("""Fields required to update gift card settings."""input: GiftCardSettingsUpdateInput!): GiftCardSettingsUpdate- """Manage shipping method's availability in channels."""+ """+ Manage shipping method's availability in channels. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingMethodChannelListingUpdate("""ID of a shipping method to update."""id: ID!@@ -7938,25 +7976,33 @@ type Mutation {input: ShippingMethodChannelListingInput!): ShippingMethodChannelListingUpdate- """Creates a new shipping price."""+ """+ Creates a new shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceCreate("""Fields required to create a shipping price."""input: ShippingPriceInput!): ShippingPriceCreate- """Deletes a shipping price."""+ """+ Deletes a shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceDelete("""ID of a shipping price to delete."""id: ID!): ShippingPriceDelete- """Deletes shipping prices."""+ """+ Deletes shipping prices. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceBulkDelete("""List of shipping price IDs to delete."""ids: [ID!]!): ShippingPriceBulkDelete- """Updates a new shipping price."""+ """+ Updates a new shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceUpdate("""ID of a shipping price to update."""id: ID!@@ -7965,7 +8011,9 @@ type Mutation {input: ShippingPriceInput!): ShippingPriceUpdate- """Creates/updates translations for a shipping method."""+ """+ Creates/updates translations for a shipping method. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """shippingPriceTranslate("""ShippingMethodType ID or ShippingMethodTranslatableContent ID."""id: ID!@@ -7975,7 +8023,9 @@ type Mutation {languageCode: LanguageCodeEnum!): ShippingPriceTranslate- """Exclude products from shipping price."""+ """+ Exclude products from shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceExcludeProducts("""ID of a shipping price."""id: ID!@@ -7984,7 +8034,9 @@ type Mutation {input: ShippingPriceExcludeProductsInput!): ShippingPriceExcludeProducts- """Remove product from excluded list for shipping price."""+ """+ Remove product from excluded list for shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingPriceRemoveProductFromExclude("""ID of a shipping price."""id: ID!@@ -7993,25 +8045,33 @@ type Mutation {products: [ID!]!): ShippingPriceRemoveProductFromExclude- """Creates a new shipping zone."""+ """+ Creates a new shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingZoneCreate("""Fields required to create a shipping zone."""input: ShippingZoneCreateInput!): ShippingZoneCreate- """Deletes a shipping zone."""+ """+ Deletes a shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingZoneDelete("""ID of a shipping zone to delete."""id: ID!): ShippingZoneDelete- """Deletes shipping zones."""+ """+ Deletes shipping zones. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingZoneBulkDelete("""List of shipping zone IDs to delete."""ids: [ID!]!): ShippingZoneBulkDelete- """Updates a new shipping zone."""+ """+ Updates a new shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+ """shippingZoneUpdate("""ID of a shipping zone to update."""id: ID!@@ -8020,7 +8080,9 @@ type Mutation {input: ShippingZoneUpdateInput!): ShippingZoneUpdate- """Assign attributes to a given product type."""+ """+ Assign attributes to a given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productAttributeAssign("""The operations to perform."""operations: [ProductAttributeAssignInput!]!@@ -8030,7 +8092,7 @@ type Mutation {): ProductAttributeAssign"""- New in Saleor 3.1. Update attributes assigned to product variant for given product type.+ New in Saleor 3.1. Update attributes assigned to product variant for given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES."""productAttributeAssignmentUpdate("""The operations to perform."""@@ -8040,7 +8102,9 @@ type Mutation {productTypeId: ID!): ProductAttributeAssignmentUpdate- """Un-assign attributes from a given product type."""+ """+ Un-assign attributes from a given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productAttributeUnassign("""The IDs of the attributes to unassign."""attributeIds: [ID!]!@@ -8049,7 +8113,9 @@ type Mutation {productTypeId: ID!): ProductAttributeUnassign- """Creates a new category."""+ """+ Creates a new category. Requires one of the following permissions: MANAGE_PRODUCTS.+ """categoryCreate("""Fields required to create a category."""input: CategoryInput!@@ -8060,19 +8126,25 @@ type Mutation {parent: ID): CategoryCreate- """Deletes a category."""+ """+ Deletes a category. Requires one of the following permissions: MANAGE_PRODUCTS.+ """categoryDelete("""ID of a category to delete."""id: ID!): CategoryDelete- """Deletes categories."""+ """+ Deletes categories. Requires one of the following permissions: MANAGE_PRODUCTS.+ """categoryBulkDelete("""List of category IDs to delete."""ids: [ID!]!): CategoryBulkDelete- """Updates a category."""+ """+ Updates a category. Requires one of the following permissions: MANAGE_PRODUCTS.+ """categoryUpdate("""ID of a category to update."""id: ID!@@ -8081,7 +8153,9 @@ type Mutation {input: CategoryInput!): CategoryUpdate- """Creates/updates translations for a category."""+ """+ Creates/updates translations for a category. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """categoryTranslate("""Category ID or CategoryTranslatableContent ID."""id: ID!@@ -8091,7 +8165,9 @@ type Mutation {languageCode: LanguageCodeEnum!): CategoryTranslate- """Adds products to a collection."""+ """+ Adds products to a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionAddProducts("""ID of a collection."""collectionId: ID!@@ -8100,19 +8176,25 @@ type Mutation {products: [ID!]!): CollectionAddProducts- """Creates a new collection."""+ """+ Creates a new collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionCreate("""Fields required to create a collection."""input: CollectionCreateInput!): CollectionCreate- """Deletes a collection."""+ """+ Deletes a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionDelete("""ID of a collection to delete."""id: ID!): CollectionDelete- """Reorder the products of a collection."""+ """+ Reorder the products of a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionReorderProducts("""ID of a collection."""collectionId: ID!@@ -8121,13 +8203,17 @@ type Mutation {moves: [MoveProductInput!]!): CollectionReorderProducts- """Deletes collections."""+ """+ Deletes collections. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionBulkDelete("""List of collection IDs to delete."""ids: [ID!]!): CollectionBulkDelete- """Remove products from a collection."""+ """+ Remove products from a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionRemoveProducts("""ID of a collection."""collectionId: ID!@@ -8136,7 +8222,9 @@ type Mutation {products: [ID!]!): CollectionRemoveProducts- """Updates a collection."""+ """+ Updates a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionUpdate("""ID of a collection to update."""id: ID!@@ -8145,7 +8233,9 @@ type Mutation {input: CollectionInput!): CollectionUpdate- """Creates/updates translations for a collection."""+ """+ Creates/updates translations for a collection. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """collectionTranslate("""Collection ID or CollectionTranslatableContent ID."""id: ID!@@ -8155,7 +8245,9 @@ type Mutation {languageCode: LanguageCodeEnum!): CollectionTranslate- """Manage collection's availability in channels."""+ """+ Manage collection's availability in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+ """collectionChannelListingUpdate("""ID of a collection to update."""id: ID!@@ -8164,25 +8256,33 @@ type Mutation {input: CollectionChannelListingUpdateInput!): CollectionChannelListingUpdate- """Creates a new product."""+ """+ Creates a new product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productCreate("""Fields required to create a product."""input: ProductCreateInput!): ProductCreate- """Deletes a product."""+ """+ Deletes a product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productDelete("""ID of a product to delete."""id: ID!): ProductDelete- """Deletes products."""+ """+ Deletes products. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productBulkDelete("""List of product IDs to delete."""ids: [ID!]!): ProductBulkDelete- """Updates an existing product."""+ """+ Updates an existing product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productUpdate("""ID of a product to update."""id: ID!@@ -8191,7 +8291,9 @@ type Mutation {input: ProductInput!): ProductUpdate- """Creates/updates translations for a product."""+ """+ Creates/updates translations for a product. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """productTranslate("""Product ID or ProductTranslatableContent ID."""id: ID!@@ -8201,7 +8303,9 @@ type Mutation {languageCode: LanguageCodeEnum!): ProductTranslate- """Manage product's availability in channels."""+ """+ Manage product's availability in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productChannelListingUpdate("""ID of a product to update."""id: ID!@@ -8211,7 +8315,7 @@ type Mutation {): ProductChannelListingUpdate"""- Create a media object (image or video URL) associated with product. For image, 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+ Create a media object (image or video URL) associated with product. For image, 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 Requires one of the following permissions: MANAGE_PRODUCTS."""productMediaCreate("""Fields required to create a product media."""@@ -8219,7 +8323,7 @@ type Mutation {): ProductMediaCreate"""- Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook.+ Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. Requires one of the following permissions: MANAGE_PRODUCTS."""productVariantReorder("""The list of variant reordering operations."""@@ -8229,19 +8333,25 @@ type Mutation {productId: ID!): ProductVariantReorder- """Deletes a product media."""+ """+ Deletes a product media. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productMediaDelete("""ID of a product media to delete."""id: ID!): ProductMediaDelete- """Deletes product media."""+ """+ Deletes product media. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productMediaBulkDelete("""List of product media IDs to delete."""ids: [ID!]!): ProductMediaBulkDelete- """Changes ordering of the product media."""+ """+ Changes ordering of the product media. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productMediaReorder("""IDs of a product media in the desired order."""mediaIds: [ID!]!@@ -8250,7 +8360,9 @@ type Mutation {productId: ID!): ProductMediaReorder- """Updates a product media."""+ """+ Updates a product media. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productMediaUpdate("""ID of a product media to update."""id: ID!@@ -8259,25 +8371,33 @@ type Mutation {input: ProductMediaUpdateInput!): ProductMediaUpdate- """Creates a new product type."""+ """+ Creates a new product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productTypeCreate("""Fields required to create a product type."""input: ProductTypeInput!): ProductTypeCreate- """Deletes a product type."""+ """+ Deletes a product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productTypeDelete("""ID of a product type to delete."""id: ID!): ProductTypeDelete- """Deletes product types."""+ """+ Deletes product types. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productTypeBulkDelete("""List of product type IDs to delete."""ids: [ID!]!): ProductTypeBulkDelete- """Updates an existing product type."""+ """+ Updates an existing product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productTypeUpdate("""ID of a product type to update."""id: ID!@@ -8286,7 +8406,9 @@ type Mutation {input: ProductTypeInput!): ProductTypeUpdate- """Reorder the attributes of a product type."""+ """+ Reorder the attributes of a product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """productTypeReorderAttributes("""The list of attribute reordering operations."""moves: [ReorderInput!]!@@ -8298,7 +8420,9 @@ type Mutation {type: ProductAttributeType!): ProductTypeReorderAttributes- """Reorder product attribute values."""+ """+ Reorder product attribute values. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productReorderAttributeValues("""ID of an attribute."""attributeId: ID!@@ -8342,19 +8466,25 @@ type Mutation {input: DigitalContentUrlCreateInput!): DigitalContentUrlCreate- """Creates a new variant for a product."""+ """+ Creates a new variant for a product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantCreate("""Fields required to create a product variant."""input: ProductVariantCreateInput!): ProductVariantCreate- """Deletes a product variant."""+ """+ Deletes a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantDelete("""ID of a product variant to delete."""id: ID!): ProductVariantDelete- """Creates product variants for a given product."""+ """+ Creates product variants for a given product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantBulkCreate("""ID of the product to create the variants for."""product: ID!@@ -8363,13 +8493,17 @@ type Mutation {variants: [ProductVariantBulkCreateInput!]!): ProductVariantBulkCreate- """Deletes product variants."""+ """+ Deletes product variants. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantBulkDelete("""List of product variant IDs to delete."""ids: [ID!]!): ProductVariantBulkDelete- """Creates stocks for product variant."""+ """+ Creates stocks for product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantStocksCreate("""Input list of stocks to create."""stocks: [StockInput!]!@@ -8378,14 +8512,18 @@ type Mutation {variantId: ID!): ProductVariantStocksCreate- """Delete stocks from product variant."""+ """+ Delete stocks from product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantStocksDelete("""ID of product variant for which stocks will be deleted."""variantId: ID!warehouseIds: [ID!]): ProductVariantStocksDelete- """Update stocks for product variant."""+ """+ Update stocks for product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantStocksUpdate("""Input list of stocks to create."""stocks: [StockInput!]!@@ -8394,7 +8532,9 @@ type Mutation {variantId: ID!): ProductVariantStocksUpdate- """Updates an existing variant for product."""+ """+ Updates an existing variant for product. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantUpdate("""ID of a product variant to update."""id: ID!@@ -8404,7 +8544,7 @@ type Mutation {): ProductVariantUpdate"""- Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook.+ Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. Requires one of the following permissions: MANAGE_PRODUCTS."""productVariantSetDefault("""Id of a product that will have the default variant set."""@@ -8414,7 +8554,9 @@ type Mutation {variantId: ID!): ProductVariantSetDefault- """Creates/updates translations for a product variant."""+ """+ Creates/updates translations for a product variant. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """productVariantTranslate("""ProductVariant ID or ProductVariantTranslatableContent ID."""id: ID!@@ -8424,7 +8566,9 @@ type Mutation {languageCode: LanguageCodeEnum!): ProductVariantTranslate- """Manage product variant prices in channels."""+ """+ Manage product variant prices in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantChannelListingUpdate("""ID of a product variant to update."""id: ID!@@ -8435,7 +8579,9 @@ type Mutation {input: [ProductVariantChannelListingAddInput!]!): ProductVariantChannelListingUpdate- """Reorder product variant attribute values."""+ """+ Reorder product variant attribute values. Requires one of the following permissions: MANAGE_PRODUCTS.+ """productVariantReorderAttributeValues("""ID of an attribute."""attributeId: ID!@@ -8448,14 +8594,16 @@ type Mutation {): ProductVariantReorderAttributeValues"""- New in Saleor 3.1. Deactivates product variant preorder. It changes all preorder allocation into regular allocation. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Deactivates product variant preorder. It changes all preorder allocation into regular allocation. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_PRODUCTS."""productVariantPreorderDeactivate("""ID of a variant which preorder should be deactivated."""id: ID!): ProductVariantPreorderDeactivate- """Assign an media to a product variant."""+ """+ Assign an media to a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """variantMediaAssign("""ID of a product media to assign to a variant."""mediaId: ID!@@ -8464,7 +8612,9 @@ type Mutation {variantId: ID!): VariantMediaAssign- """Unassign an media from a product variant."""+ """+ Unassign an media from a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+ """variantMediaUnassign("""ID of a product media to unassign from a variant."""mediaId: ID!@@ -8473,7 +8623,9 @@ type Mutation {variantId: ID!): VariantMediaUnassign- """Captures the authorized payment amount."""+ """+ Captures the authorized payment amount. Requires one of the following permissions: MANAGE_ORDERS.+ """paymentCapture("""Transaction amount."""amount: PositiveDecimal@@ -8482,7 +8634,9 @@ type Mutation {paymentId: ID!): PaymentCapture- """Refunds the captured payment amount."""+ """+ Refunds the captured payment amount. Requires one of the following permissions: MANAGE_ORDERS.+ """paymentRefund("""Transaction amount."""amount: PositiveDecimal@@ -8491,7 +8645,9 @@ type Mutation {paymentId: ID!): PaymentRefund- """Voids the authorized payment."""+ """+ Voids the authorized payment. Requires one of the following permissions: MANAGE_ORDERS.+ """paymentVoid("""Payment ID."""paymentId: ID!@@ -8515,25 +8671,33 @@ type Mutation {input: PaymentCheckBalanceInput!): PaymentCheckBalance- """Creates a new page."""+ """+ Creates a new page. Requires one of the following permissions: MANAGE_PAGES.+ """pageCreate("""Fields required to create a page."""input: PageCreateInput!): PageCreate- """Deletes a page."""+ """+ Deletes a page. Requires one of the following permissions: MANAGE_PAGES.+ """pageDelete("""ID of a page to delete."""id: ID!): PageDelete- """Deletes pages."""+ """+ Deletes pages. Requires one of the following permissions: MANAGE_PAGES.+ """pageBulkDelete("""List of page IDs to delete."""ids: [ID!]!): PageBulkDelete- """Publish pages."""+ """+ Publish pages. Requires one of the following permissions: MANAGE_PAGES.+ """pageBulkPublish("""List of page IDs to (un)publish."""ids: [ID!]!@@ -8542,7 +8706,9 @@ type Mutation {isPublished: Boolean!): PageBulkPublish- """Updates an existing page."""+ """+ Updates an existing page. Requires one of the following permissions: MANAGE_PAGES.+ """pageUpdate("""ID of a page to update."""id: ID!@@ -8551,7 +8717,9 @@ type Mutation {input: PageInput!): PageUpdate- """Creates/updates translations for a page."""+ """+ Creates/updates translations for a page. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """pageTranslate("""Page ID or PageTranslatableContent ID."""id: ID!@@ -8561,13 +8729,17 @@ type Mutation {languageCode: LanguageCodeEnum!): PageTranslate- """Create a new page type."""+ """+ Create a new page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageTypeCreate("""Fields required to create page type."""input: PageTypeCreateInput!): PageTypeCreate- """Update page type."""+ """+ Update page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageTypeUpdate("""ID of the page type to update."""id: ID@@ -8576,19 +8748,25 @@ type Mutation {input: PageTypeUpdateInput!): PageTypeUpdate- """Delete a page type."""+ """+ Delete a page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageTypeDelete("""ID of the page type to delete."""id: ID!): PageTypeDelete- """Delete page types."""+ """+ Delete page types. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageTypeBulkDelete("""List of page type IDs to delete"""ids: [ID!]!): PageTypeBulkDelete- """Assign attributes to a given page type."""+ """+ Assign attributes to a given page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageAttributeAssign("""The IDs of the attributes to assign."""attributeIds: [ID!]!@@ -8597,7 +8775,9 @@ type Mutation {pageTypeId: ID!): PageAttributeAssign- """Unassign attributes from a given page type."""+ """+ Unassign attributes from a given page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageAttributeUnassign("""The IDs of the attributes to unassign."""attributeIds: [ID!]!@@ -8606,7 +8786,9 @@ type Mutation {pageTypeId: ID!): PageAttributeUnassign- """Reorder the attributes of a page type."""+ """+ Reorder the attributes of a page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """pageTypeReorderAttributes("""The list of attribute reordering operations."""moves: [ReorderInput!]!@@ -8615,7 +8797,9 @@ type Mutation {pageTypeId: ID!): PageTypeReorderAttributes- """Reorder page attribute values."""+ """+ Reorder page attribute values. Requires one of the following permissions: MANAGE_PAGES.+ """pageReorderAttributeValues("""ID of an attribute."""attributeId: ID!@@ -8627,37 +8811,49 @@ type Mutation {pageId: ID!): PageReorderAttributeValues- """Completes creating an order."""+ """+ Completes creating an order. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderComplete("""ID of the order that will be completed."""id: ID!): DraftOrderComplete- """Creates a new draft order."""+ """+ Creates a new draft order. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderCreate("""Fields required to create an order."""input: DraftOrderCreateInput!): DraftOrderCreate- """Deletes a draft order."""+ """+ Deletes a draft order. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderDelete("""ID of a draft order to delete."""id: ID!): DraftOrderDelete- """Deletes draft orders."""+ """+ Deletes draft orders. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderBulkDelete("""List of draft order IDs to delete."""ids: [ID!]!): DraftOrderBulkDelete- """Deletes order lines."""+ """+ Deletes order lines. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderLinesBulkDelete("""List of order lines IDs to delete."""ids: [ID!]!): DraftOrderLinesBulkDelete @deprecated(reason: "This field will be removed in Saleor 4.0.")- """Updates a draft order."""+ """+ Updates a draft order. Requires one of the following permissions: MANAGE_ORDERS.+ """draftOrderUpdate("""ID of a draft order to update."""id: ID!@@ -8666,7 +8862,9 @@ type Mutation {input: DraftOrderInput!): DraftOrderUpdate- """Adds note to the order."""+ """+ Adds note to the order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderAddNote("""ID of the order to add a note for."""order: ID!@@ -8675,13 +8873,17 @@ type Mutation {input: OrderAddNoteInput!): OrderAddNote- """Cancel an order."""+ """+ Cancel an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderCancel("""ID of the order to cancel."""id: ID!): OrderCancel- """Capture an order."""+ """+ Capture an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderCapture("""Amount of money to capture."""amount: PositiveDecimal!@@ -8690,13 +8892,17 @@ type Mutation {id: ID!): OrderCapture- """Confirms an unconfirmed order by changing status to unfulfilled."""+ """+ Confirms an unconfirmed order by changing status to unfulfilled. Requires one of the following permissions: MANAGE_ORDERS.+ """orderConfirm("""ID of an order to confirm."""id: ID!): OrderConfirm- """Creates new fulfillments for an order."""+ """+ Creates new fulfillments for an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfill("""Fields required to create a fulfillment."""input: OrderFulfillInput!@@ -8705,7 +8911,9 @@ type Mutation {order: ID): OrderFulfill- """Cancels existing fulfillment and optionally restocks items."""+ """+ Cancels existing fulfillment and optionally restocks items. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfillmentCancel("""ID of a fulfillment to cancel."""id: ID!@@ -8714,7 +8922,9 @@ type Mutation {input: FulfillmentCancelInput): FulfillmentCancel- """New in Saleor 3.1. Approve existing fulfillment."""+ """+ New in Saleor 3.1. Approve existing fulfillment. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfillmentApprove("""True if stock could be exceeded."""allowStockToBeExceeded: Boolean = false@@ -8726,7 +8936,9 @@ type Mutation {notifyCustomer: Boolean!): FulfillmentApprove- """Updates a fulfillment for an order."""+ """+ Updates a fulfillment for an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfillmentUpdateTracking("""ID of a fulfillment to update."""id: ID!@@ -8735,7 +8947,9 @@ type Mutation {input: FulfillmentUpdateTrackingInput!): FulfillmentUpdateTracking- """Refund products."""+ """+ Refund products. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfillmentRefundProducts("""Fields required to create an refund fulfillment."""input: OrderRefundProductsInput!@@ -8744,7 +8958,9 @@ type Mutation {order: ID!): FulfillmentRefundProducts- """Return products."""+ """+ Return products. Requires one of the following permissions: MANAGE_ORDERS.+ """orderFulfillmentReturnProducts("""Fields required to return products."""input: OrderReturnProductsInput!@@ -8753,7 +8969,9 @@ type Mutation {order: ID!): FulfillmentReturnProducts- """Create order lines for an order."""+ """+ Create order lines for an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderLinesCreate("""ID of the order to add the lines to."""id: ID!@@ -8762,13 +8980,17 @@ type Mutation {input: [OrderLineCreateInput!]!): OrderLinesCreate- """Deletes an order line from an order."""+ """+ Deletes an order line from an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderLineDelete("""ID of the order line to delete."""id: ID!): OrderLineDelete- """Updates an order line of an order."""+ """+ Updates an order line of an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderLineUpdate("""ID of the order line to update."""id: ID!@@ -8777,7 +8999,9 @@ type Mutation {input: OrderLineInput!): OrderLineUpdate- """Adds discount to the order."""+ """+ Adds discount to the order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderDiscountAdd("""Fields required to create a discount for the order."""input: OrderDiscountCommonInput!@@ -8786,7 +9010,9 @@ type Mutation {orderId: ID!): OrderDiscountAdd- """Update discount for the order."""+ """+ Update discount for the order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderDiscountUpdate("""ID of a discount to update."""discountId: ID!@@ -8795,13 +9021,17 @@ type Mutation {input: OrderDiscountCommonInput!): OrderDiscountUpdate- """Remove discount from the order."""+ """+ Remove discount from the order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderDiscountDelete("""ID of a discount to remove."""discountId: ID!): OrderDiscountDelete- """Update discount for the order line."""+ """+ Update discount for the order line. Requires one of the following permissions: MANAGE_ORDERS.+ """orderLineDiscountUpdate("""Fields required to update price for the order line."""input: OrderDiscountCommonInput!@@ -8810,13 +9040,17 @@ type Mutation {orderLineId: ID!): OrderLineDiscountUpdate- """Remove discount applied to the order line."""+ """+ Remove discount applied to the order line. Requires one of the following permissions: MANAGE_ORDERS.+ """orderLineDiscountRemove("""ID of a order line to remove its discount"""orderLineId: ID!): OrderLineDiscountRemove- """Mark order as manually paid."""+ """+ Mark order as manually paid. Requires one of the following permissions: MANAGE_ORDERS.+ """orderMarkAsPaid("""ID of the order to mark paid."""id: ID!@@ -8825,7 +9059,9 @@ type Mutation {transactionReference: String): OrderMarkAsPaid- """Refund an order."""+ """+ Refund an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderRefund("""Amount of money to refund."""amount: PositiveDecimal!@@ -8834,7 +9070,9 @@ type Mutation {id: ID!): OrderRefund- """Updates an order."""+ """+ Updates an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderUpdate("""ID of an order to update."""id: ID!@@ -8844,7 +9082,7 @@ type Mutation {): OrderUpdate"""- Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed.+ Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. Requires one of the following permissions: MANAGE_ORDERS."""orderUpdateShipping("""ID of the order to update a shipping method."""@@ -8854,19 +9092,25 @@ type Mutation {input: OrderUpdateShippingInput!): OrderUpdateShipping- """Void an order."""+ """+ Void an order. Requires one of the following permissions: MANAGE_ORDERS.+ """orderVoid("""ID of the order to void."""id: ID!): OrderVoid- """Cancels orders."""+ """+ Cancels orders. Requires one of the following permissions: MANAGE_ORDERS.+ """orderBulkCancel("""List of orders IDs to cancel."""ids: [ID!]!): OrderBulkCancel- """Delete metadata of an object."""+ """+ Delete metadata of an object. To use it, you need to have access to the modified object.+ """deleteMetadata("""ID or token (for Order and Checkout) of an object to update."""id: ID!@@ -8875,7 +9119,9 @@ type Mutation {keys: [String!]!): DeleteMetadata- """Delete object's private metadata."""+ """+ Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object.+ """deletePrivateMetadata("""ID or token (for Order and Checkout) of an object to update."""id: ID!@@ -8884,7 +9130,9 @@ type Mutation {keys: [String!]!): DeletePrivateMetadata- """Updates metadata of an object."""+ """+ Updates metadata of an object. To use it, you need to have access to the modified object.+ """updateMetadata("""ID or token (for Order and Checkout) of an object to update."""id: ID!@@ -8893,7 +9141,9 @@ type Mutation {input: [MetadataInput!]!): UpdateMetadata- """Updates private metadata of an object."""+ """+ Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object.+ """updatePrivateMetadata("""ID or token (for Order and Checkout) of an object to update."""id: ID!@@ -8902,7 +9152,9 @@ type Mutation {input: [MetadataInput!]!): UpdatePrivateMetadata- """Assigns storefront's navigation menus."""+ """+ Assigns storefront's navigation menus. Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS.+ """assignNavigation("""ID of the menu."""menu: ID@@ -8911,25 +9163,33 @@ type Mutation {navigationType: NavigationType!): AssignNavigation- """Creates a new Menu."""+ """+ Creates a new Menu. Requires one of the following permissions: MANAGE_MENUS.+ """menuCreate("""Fields required to create a menu."""input: MenuCreateInput!): MenuCreate- """Deletes a menu."""+ """+ Deletes a menu. Requires one of the following permissions: MANAGE_MENUS.+ """menuDelete("""ID of a menu to delete."""id: ID!): MenuDelete- """Deletes menus."""+ """+ Deletes menus. Requires one of the following permissions: MANAGE_MENUS.+ """menuBulkDelete("""List of menu IDs to delete."""ids: [ID!]!): MenuBulkDelete- """Updates a menu."""+ """+ Updates a menu. Requires one of the following permissions: MANAGE_MENUS.+ """menuUpdate("""ID of a menu to update."""id: ID!@@ -8938,7 +9198,9 @@ type Mutation {input: MenuInput!): MenuUpdate- """Creates a new menu item."""+ """+ Creates a new menu item. Requires one of the following permissions: MANAGE_MENUS.+ """menuItemCreate("""Fields required to update a menu item. Only one of `url`, `category`, `page`, `collection` is allowed per item.@@ -8946,19 +9208,25 @@ type Mutation {input: MenuItemCreateInput!): MenuItemCreate- """Deletes a menu item."""+ """+ Deletes a menu item. Requires one of the following permissions: MANAGE_MENUS.+ """menuItemDelete("""ID of a menu item to delete."""id: ID!): MenuItemDelete- """Deletes menu items."""+ """+ Deletes menu items. Requires one of the following permissions: MANAGE_MENUS.+ """menuItemBulkDelete("""List of menu item IDs to delete."""ids: [ID!]!): MenuItemBulkDelete- """Updates a menu item."""+ """+ Updates a menu item. Requires one of the following permissions: MANAGE_MENUS.+ """menuItemUpdate("""ID of a menu item to update."""id: ID!@@ -8969,7 +9237,9 @@ type Mutation {input: MenuItemInput!): MenuItemUpdate- """Creates/updates translations for a menu item."""+ """+ Creates/updates translations for a menu item. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """menuItemTranslate("""MenuItem ID or MenuItemTranslatableContent ID."""id: ID!@@ -8979,7 +9249,9 @@ type Mutation {languageCode: LanguageCodeEnum!): MenuItemTranslate- """Moves items of menus."""+ """+ Moves items of menus. Requires one of the following permissions: MANAGE_MENUS.+ """menuItemMove("""ID of the menu."""menu: ID!@@ -8988,7 +9260,9 @@ type Mutation {moves: [MenuItemMoveInput!]!): MenuItemMove- """Request an invoice for the order using plugin."""+ """+ Request an invoice for the order using plugin. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceRequest("""Invoice number, if not provided it will be generated."""number: String@@ -8997,13 +9271,17 @@ type Mutation {orderId: ID!): InvoiceRequest- """Requests deletion of an invoice."""+ """+ Requests deletion of an invoice. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceRequestDelete("""ID of an invoice to request the deletion."""id: ID!): InvoiceRequestDelete- """Creates a ready to send invoice."""+ """+ Creates a ready to send invoice. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceCreate("""Fields required when creating an invoice."""input: InvoiceCreateInput!@@ -9012,13 +9290,17 @@ type Mutation {orderId: ID!): InvoiceCreate- """Deletes an invoice."""+ """+ Deletes an invoice. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceDelete("""ID of an invoice to delete."""id: ID!): InvoiceDelete- """Updates an invoice."""+ """+ Updates an invoice. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceUpdate("""ID of an invoice to update."""id: ID!@@ -9027,39 +9309,49 @@ type Mutation {input: UpdateInvoiceInput!): InvoiceUpdate- """Send an invoice notification to the customer."""+ """+ Send an invoice notification to the customer. Requires one of the following permissions: MANAGE_ORDERS.+ """invoiceSendNotification("""ID of an invoice to be sent."""id: ID!): InvoiceSendNotification- """Activate a gift card."""+ """+ Activate a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+ """giftCardActivate("""ID of a gift card to activate."""id: ID!): GiftCardActivate- """Creates a new gift card."""+ """+ Creates a new gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+ """giftCardCreate("""Fields required to create a gift card."""input: GiftCardCreateInput!): GiftCardCreate"""- New in Saleor 3.1. Delete gift card. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Delete gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardDelete("""ID of the gift card to delete."""id: ID!): GiftCardDelete- """Deactivate a gift card."""+ """+ Deactivate a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+ """giftCardDeactivate("""ID of a gift card to deactivate."""id: ID!): GiftCardDeactivate- """Update a gift card."""+ """+ Update a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+ """giftCardUpdate("""ID of a gift card to update."""id: ID!@@ -9069,7 +9361,7 @@ type Mutation {): GiftCardUpdate"""- New in Saleor 3.1. Resend a gift card. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Resend a gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardResend("""Fields required to resend a gift card."""@@ -9077,7 +9369,7 @@ type Mutation {): GiftCardResend"""- New in Saleor 3.1. Adds note to the gift card. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Adds note to the gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardAddNote("""ID of the gift card to add a note for."""@@ -9088,7 +9380,7 @@ type Mutation {): GiftCardAddNote"""- New in Saleor 3.1. Create gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Create gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardBulkCreate("""Fields required to create gift cards."""@@ -9096,7 +9388,7 @@ type Mutation {): GiftCardBulkCreate"""- New in Saleor 3.1. Delete gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Delete gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardBulkDelete("""List of gift card IDs to delete."""@@ -9104,7 +9396,7 @@ type Mutation {): GiftCardBulkDelete"""- New in Saleor 3.1. Activate gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Activate gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardBulkActivate("""List of gift card IDs to activate."""@@ -9112,14 +9404,16 @@ type Mutation {): GiftCardBulkActivate"""- New in Saleor 3.1. Deactivate gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Deactivate gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""giftCardBulkDeactivate("""List of gift card IDs to deactivate."""ids: [ID!]!): GiftCardBulkDeactivate- """Update plugin configuration."""+ """+ Update plugin configuration. Requires one of the following permissions: MANAGE_PLUGINS.+ """pluginUpdate("""ID of a channel for which the data should be modified."""channelId: ID@@ -9147,25 +9441,33 @@ type Mutation {pluginId: String): ExternalNotificationTrigger- """Creates a new sale."""+ """+ Creates a new sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleCreate("""Fields required to create a sale."""input: SaleInput!): SaleCreate- """Deletes a sale."""+ """+ Deletes a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleDelete("""ID of a sale to delete."""id: ID!): SaleDelete- """Deletes sales."""+ """+ Deletes sales. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleBulkDelete("""List of sale IDs to delete."""ids: [ID!]!): SaleBulkDelete- """Updates a sale."""+ """+ Updates a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleUpdate("""ID of a sale to update."""id: ID!@@ -9174,7 +9476,9 @@ type Mutation {input: SaleInput!): SaleUpdate- """Adds products, categories, collections to a voucher."""+ """+ Adds products, categories, collections to a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleCataloguesAdd("""ID of a sale."""id: ID!@@ -9183,7 +9487,9 @@ type Mutation {input: CatalogueInput!): SaleAddCatalogues- """Removes products, categories, collections from a sale."""+ """+ Removes products, categories, collections from a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleCataloguesRemove("""ID of a sale."""id: ID!@@ -9192,7 +9498,9 @@ type Mutation {input: CatalogueInput!): SaleRemoveCatalogues- """Creates/updates translations for a sale."""+ """+ Creates/updates translations for a sale. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """saleTranslate("""Sale ID or SaleTranslatableContent ID."""id: ID!@@ -9202,7 +9510,9 @@ type Mutation {languageCode: LanguageCodeEnum!): SaleTranslate- """Manage sale's availability in channels."""+ """+ Manage sale's availability in channels. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """saleChannelListingUpdate("""ID of a sale to update."""id: ID!@@ -9211,25 +9521,33 @@ type Mutation {input: SaleChannelListingInput!): SaleChannelListingUpdate- """Creates a new voucher."""+ """+ Creates a new voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherCreate("""Fields required to create a voucher."""input: VoucherInput!): VoucherCreate- """Deletes a voucher."""+ """+ Deletes a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherDelete("""ID of a voucher to delete."""id: ID!): VoucherDelete- """Deletes vouchers."""+ """+ Deletes vouchers. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherBulkDelete("""List of voucher IDs to delete."""ids: [ID!]!): VoucherBulkDelete- """Updates a voucher."""+ """+ Updates a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherUpdate("""ID of a voucher to update."""id: ID!@@ -9238,7 +9556,9 @@ type Mutation {input: VoucherInput!): VoucherUpdate- """Adds products, categories, collections to a voucher."""+ """+ Adds products, categories, collections to a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherCataloguesAdd("""ID of a voucher."""id: ID!@@ -9247,7 +9567,9 @@ type Mutation {input: CatalogueInput!): VoucherAddCatalogues- """Removes products, categories, collections from a voucher."""+ """+ Removes products, categories, collections from a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherCataloguesRemove("""ID of a voucher."""id: ID!@@ -9256,7 +9578,9 @@ type Mutation {input: CatalogueInput!): VoucherRemoveCatalogues- """Creates/updates translations for a voucher."""+ """+ Creates/updates translations for a voucher. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """voucherTranslate("""Voucher ID or VoucherTranslatableContent ID."""id: ID!@@ -9266,7 +9590,9 @@ type Mutation {languageCode: LanguageCodeEnum!): VoucherTranslate- """Manage voucher's availability in channels."""+ """+ Manage voucher's availability in channels. Requires one of the following permissions: MANAGE_DISCOUNTS.+ """voucherChannelListingUpdate("""ID of a voucher to update."""id: ID!@@ -9275,14 +9601,16 @@ type Mutation {input: VoucherChannelListingInput!): VoucherChannelListingUpdate- """Export products to csv file."""+ """+ Export products to csv file. Requires one of the following permissions: MANAGE_PRODUCTS.+ """exportProducts("""Fields required to export product data."""input: ExportProductsInput!): ExportProducts"""- New in Saleor 3.1. Export gift cards to csv file. Note: this feature is in a preview state and can be subject to changes at later point.+ New in Saleor 3.1. Export gift cards to csv file. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""exportGiftCards("""Fields required to export gift cards data."""@@ -9365,7 +9693,9 @@ type Mutation {input: CheckoutCreateInput!): CheckoutCreate- """Sets the customer as the owner of the checkout."""+ """+ Sets the customer as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.+ """checkoutCustomerAttach("""The ID of the checkout.@@ -9383,7 +9713,9 @@ type Mutation {token: UUID): CheckoutCustomerAttach- """Removes the user assigned as the owner of the checkout."""+ """+ Removes the user assigned as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.+ """checkoutCustomerDetach("""The ID of the checkout.@@ -9569,13 +9901,17 @@ type Mutation {token: UUID): CheckoutLanguageCodeUpdate- """Creates new channel."""+ """+ Creates new channel. Requires one of the following permissions: MANAGE_CHANNELS.+ """channelCreate("""Fields required to create channel."""input: ChannelCreateInput!): ChannelCreate- """Update a channel."""+ """+ Update a channel. Requires one of the following permissions: MANAGE_CHANNELS.+ """channelUpdate("""ID of a channel to update."""id: ID!@@ -9585,7 +9921,7 @@ type Mutation {): ChannelUpdate"""- Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed.+ 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."""channelDelete("""ID of a channel to delete."""@@ -9595,13 +9931,17 @@ type Mutation {input: ChannelDeleteInput): ChannelDelete- """Activate a channel."""+ """+ Activate a channel. Requires one of the following permissions: MANAGE_CHANNELS.+ """channelActivate("""ID of the channel to activate."""id: ID!): ChannelActivate- """Deactivate a channel."""+ """+ Deactivate a channel. Requires one of the following permissions: MANAGE_CHANNELS.+ """channelDeactivate("""ID of the channel to deactivate."""id: ID!@@ -9613,13 +9953,17 @@ type Mutation {input: AttributeCreateInput!): AttributeCreate- """Deletes an attribute."""+ """+ Deletes an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """attributeDelete("""ID of an attribute to delete."""id: ID!): AttributeDelete- """Updates attribute."""+ """+ Updates attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """attributeUpdate("""ID of an attribute to update."""id: ID!@@ -9628,7 +9972,9 @@ type Mutation {input: AttributeUpdateInput!): AttributeUpdate- """Creates/updates translations for an attribute."""+ """+ Creates/updates translations for an attribute. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """attributeTranslate("""Attribute ID or AttributeTranslatableContent ID."""id: ID!@@ -9638,19 +9984,25 @@ type Mutation {languageCode: LanguageCodeEnum!): AttributeTranslate- """Deletes attributes."""+ """+ Deletes attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """attributeBulkDelete("""List of attribute IDs to delete."""ids: [ID!]!): AttributeBulkDelete- """Deletes values of attributes."""+ """+ Deletes values of attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+ """attributeValueBulkDelete("""List of attribute value IDs to delete."""ids: [ID!]!): AttributeValueBulkDelete- """Creates a value for an attribute."""+ """+ Creates a value for an attribute. Requires one of the following permissions: MANAGE_PRODUCTS.+ """attributeValueCreate("""Attribute to which value will be assigned."""attribute: ID!@@ -9659,13 +10011,17 @@ type Mutation {input: AttributeValueCreateInput!): AttributeValueCreate- """Deletes a value of an attribute."""+ """+ Deletes a value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """attributeValueDelete("""ID of a value to delete."""id: ID!): AttributeValueDelete- """Updates value of an attribute."""+ """+ Updates value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """attributeValueUpdate("""ID of an AttributeValue to update."""id: ID!@@ -9674,7 +10030,9 @@ type Mutation {input: AttributeValueUpdateInput!): AttributeValueUpdate- """Creates/updates translations for an attribute value."""+ """+ Creates/updates translations for an attribute value. Requires one of the following permissions: MANAGE_TRANSLATIONS.+ """attributeValueTranslate("""AttributeValue ID or AttributeValueTranslatableContent ID."""id: ID!@@ -9684,7 +10042,9 @@ type Mutation {languageCode: LanguageCodeEnum!): AttributeValueTranslate- """Reorder the values of an attribute."""+ """+ Reorder the values of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+ """attributeReorderValues("""ID of an attribute."""attributeId: ID!@@ -9693,13 +10053,17 @@ type Mutation {moves: [ReorderInput!]!): AttributeReorderValues- """Creates a new app."""+ """+ Creates a new app. Requires one of the following permissions: MANAGE_APPS.+ """appCreate("""Fields required to create a new app."""input: AppInput!): AppCreate- """Updates an existing app."""+ """+ Updates an existing app. Requires one of the following permissions: MANAGE_APPS.+ """appUpdate("""ID of an app to update."""id: ID!@@ -9708,19 +10072,25 @@ type Mutation {input: AppInput!): AppUpdate- """Deletes an app."""+ """+ Deletes an app. Requires one of the following permissions: MANAGE_APPS.+ """appDelete("""ID of an app to delete."""id: ID!): AppDelete- """Creates a new token."""+ """+ Creates a new token. Requires one of the following permissions: MANAGE_APPS.+ """appTokenCreate("""Fields required to create a new auth token."""input: AppTokenInput!): AppTokenCreate- """Deletes an authentication token assigned to app."""+ """+ Deletes an authentication token assigned to app. Requires one of the following permissions: MANAGE_APPS.+ """appTokenDelete("""ID of an auth token to delete."""id: ID!@@ -9732,13 +10102,17 @@ type Mutation {token: String!): AppTokenVerify- """Install new app by using app manifest."""+ """+ Install new app by using app manifest. Requires one of the following permissions: MANAGE_APPS.+ """appInstall("""Fields required to install a new app."""input: AppInstallInput!): AppInstall- """Retry failed installation of new app."""+ """+ Retry failed installation of new app. Requires one of the following permissions: MANAGE_APPS.+ """appRetryInstall("""Determine if app will be set active or not."""activateAfterInstallation: Boolean = true@@ -9747,22 +10121,30 @@ type Mutation {id: ID!): AppRetryInstall- """Delete failed installation."""+ """+ Delete failed installation. Requires one of the following permissions: MANAGE_APPS.+ """appDeleteFailedInstallation("""ID of failed installation to delete."""id: ID!): AppDeleteFailedInstallation- """Fetch and validate manifest."""+ """+ Fetch and validate manifest. Requires one of the following permissions: MANAGE_APPS.+ """appFetchManifest(manifestUrl: String!): AppFetchManifest- """Activate the app."""+ """+ Activate the app. Requires one of the following permissions: MANAGE_APPS.+ """appActivate("""ID of app to activate."""id: ID!): AppActivate- """Deactivate the app."""+ """+ Deactivate the app. Requires one of the following permissions: MANAGE_APPS.+ """appDeactivate("""ID of app to deactivate."""id: ID!@@ -9796,7 +10178,9 @@ type Mutation {token: String!): VerifyToken- """Deactivate all JWT tokens of the currently authenticated user."""+ """+ Deactivate all JWT tokens of the currently authenticated user. Requires one of the following permissions: AUTHENTICATED_USER.+ """tokensDeactivateAll: DeactivateAllUserTokens"""Prepare external authentication url for user by custom plugin."""@@ -9883,7 +10267,9 @@ type Mutation {token: String!): SetPassword- """Change the password of the logged in user."""+ """+ Change the password of the logged in user. Requires one of the following permissions: AUTHENTICATED_USER.+ """passwordChange("""New user password."""newPassword: String!@@ -9892,7 +10278,9 @@ type Mutation {oldPassword: String!): PasswordChange- """Request email change of the logged in user."""+ """+ Request email change of the logged in user. Requires one of the following permissions: AUTHENTICATED_USER.+ """requestEmailChange("""Slug of a channel which will be used to notify users. Optional when only one channel exists.@@ -9911,7 +10299,9 @@ type Mutation {redirectUrl: String!): RequestEmailChange- """Confirm the email change of the logged-in user."""+ """+ Confirm the email change of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+ """confirmEmailChange("""Slug of a channel which will be used to notify users. Optional when only one channel exists.@@ -9922,7 +10312,9 @@ type Mutation {token: String!): ConfirmEmailChange- """Create a new address for the customer."""+ """+ Create a new address for the customer. Requires one of the following permissions: AUTHENTICATED_USER.+ """accountAddressCreate("""Fields required to create address."""input: AddressInput!@@ -9933,7 +10325,9 @@ type Mutation {type: AddressTypeEnum): AccountAddressCreate- """Updates an address of the logged-in user."""+ """+ Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.+ """accountAddressUpdate("""ID of the address to update."""id: ID!@@ -9942,13 +10336,17 @@ type Mutation {input: AddressInput!): AccountAddressUpdate- """Delete an address of the logged-in user."""+ """+ Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.+ """accountAddressDelete("""ID of the address to delete."""id: ID!): AccountAddressDelete- """Sets a default address for the authenticated user."""+ """+ Sets a default address for the authenticated user. Requires one of the following permissions: AUTHENTICATED_USER.+ """accountSetDefaultAddress("""ID of the address to set as default."""id: ID!@@ -9963,13 +10361,17 @@ type Mutation {input: AccountRegisterInput!): AccountRegister- """Updates the account of the logged-in user."""+ """+ Updates the account of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+ """accountUpdate("""Fields required to update the account of the logged-in user."""input: AccountInput!): AccountUpdate- """Sends an email with the account removal link for the logged-in user."""+ """+ Sends an email with the account removal link for the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+ """accountRequestDeletion("""Slug of a channel which will be used to notify users. Optional when only one channel exists.@@ -9982,7 +10384,9 @@ type Mutation {redirectUrl: String!): AccountRequestDeletion- """Remove user account."""+ """+ Remove user account. Requires one of the following permissions: AUTHENTICATED_USER.+ """accountDelete("""A one-time token required to remove account. Sent by email using AccountRequestDeletion mutation.@@ -9990,7 +10394,9 @@ type Mutation {token: String!): AccountDelete- """Creates user address."""+ """+ Creates user address. Requires one of the following permissions: MANAGE_USERS.+ """addressCreate("""Fields required to create address."""input: AddressInput!@@ -9999,7 +10405,9 @@ type Mutation {userId: ID!): AddressCreate- """Updates an address."""+ """+ Updates an address. Requires one of the following permissions: MANAGE_USERS.+ """addressUpdate("""ID of the address to update."""id: ID!@@ -10008,13 +10416,17 @@ type Mutation {input: AddressInput!): AddressUpdate- """Deletes an address."""+ """+ Deletes an address. Requires one of the following permissions: MANAGE_USERS.+ """addressDelete("""ID of the address to delete."""id: ID!): AddressDelete- """Sets a default address for the given user."""+ """+ Sets a default address for the given user. Requires one of the following permissions: MANAGE_USERS.+ """addressSetDefault("""ID of the address."""addressId: ID!@@ -10026,13 +10438,17 @@ type Mutation {userId: ID!): AddressSetDefault- """Creates a new customer."""+ """+ Creates a new customer. Requires one of the following permissions: MANAGE_USERS.+ """customerCreate("""Fields required to create a customer."""input: UserCreateInput!): CustomerCreate- """Updates an existing customer."""+ """+ Updates an existing customer. Requires one of the following permissions: MANAGE_USERS.+ """customerUpdate("""ID of a customer to update."""id: ID!@@ -10041,25 +10457,33 @@ type Mutation {input: CustomerInput!): CustomerUpdate- """Deletes a customer."""+ """+ Deletes a customer. Requires one of the following permissions: MANAGE_USERS.+ """customerDelete("""ID of a customer to delete."""id: ID!): CustomerDelete- """Deletes customers."""+ """+ Deletes customers. Requires one of the following permissions: MANAGE_USERS.+ """customerBulkDelete("""List of user IDs to delete."""ids: [ID!]!): CustomerBulkDelete- """Creates a new staff user."""+ """+ Creates a new staff user. Requires one of the following permissions: MANAGE_STAFF.+ """staffCreate("""Fields required to create a staff user."""input: StaffCreateInput!): StaffCreate- """Updates an existing staff user."""+ """+ Updates an existing staff user. Requires one of the following permissions: MANAGE_STAFF.+ """staffUpdate("""ID of a staff user to update."""id: ID!@@ -10068,13 +10492,17 @@ type Mutation {input: StaffUpdateInput!): StaffUpdate- """Deletes a staff user."""+ """+ Deletes a staff user. Requires one of the following permissions: MANAGE_STAFF.+ """staffDelete("""ID of a staff user to delete."""id: ID!): StaffDelete- """Deletes staff users."""+ """+ Deletes staff users. Requires one of the following permissions: MANAGE_STAFF.+ """staffBulkDelete("""List of user IDs to delete."""ids: [ID!]!@@ -10091,7 +10519,9 @@ type Mutation {"""Deletes a user avatar. Only for staff members."""userAvatarDelete: UserAvatarDelete- """Activate or deactivate users."""+ """+ Activate or deactivate users. Requires one of the following permissions: MANAGE_USERS.+ """userBulkSetActive("""List of user IDs to (de)activate)."""ids: [ID!]!@@ -10100,13 +10530,17 @@ type Mutation {isActive: Boolean!): UserBulkSetActive- """Create new permission group."""+ """+ Create new permission group. Requires one of the following permissions: MANAGE_STAFF.+ """permissionGroupCreate("""Input fields to create permission group."""input: PermissionGroupCreateInput!): PermissionGroupCreate- """Update permission group."""+ """+ Update permission group. Requires one of the following permissions: MANAGE_STAFF.+ """permissionGroupUpdate("""ID of the group to update."""id: ID!@@ -10115,14 +10549,18 @@ type Mutation {input: PermissionGroupUpdateInput!): PermissionGroupUpdate- """Delete permission group."""+ """+ Delete permission group. Requires one of the following permissions: MANAGE_STAFF.+ """permissionGroupDelete("""ID of the group to delete."""id: ID!): PermissionGroupDelete}-"""Creates a new webhook subscription."""+"""+Creates a new webhook subscription. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.+"""type WebhookCreate {webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WebhookError!]!@@ -10181,14 +10619,18 @@ input WebhookCreateInput {secretKey: String}-"""Deletes a webhook subscription."""+"""+Deletes a webhook subscription. Requires one of the following permissions: MANAGE_APPS, AUTHENTICATED_APP.+"""type WebhookDelete {webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WebhookError!]!webhook: Webhook}-"""Updates a webhook subscription."""+"""+Updates a webhook subscription. Requires one of the following permissions: MANAGE_APPS.+"""type WebhookUpdate {webhookErrors: [WebhookError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WebhookError!]!@@ -10225,14 +10667,18 @@ input WebhookUpdateInput {secretKey: String}-"""Retries event delivery."""+"""+Retries event delivery. Requires one of the following permissions: MANAGE_APPS.+"""type EventDeliveryRetry {"""Event delivery."""delivery: EventDeliveryerrors: [WebhookError!]!}-"""Creates new warehouse."""+"""+Creates new warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type WarehouseCreate {warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WarehouseError!]!@@ -10279,7 +10725,9 @@ input WarehouseCreateInput {shippingZones: [ID!]}-"""Updates given warehouse."""+"""+Updates given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type WarehouseUpdate {warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WarehouseError!]!@@ -10310,28 +10758,36 @@ input WarehouseUpdateInput {isPrivate: Boolean}-"""Deletes selected warehouse."""+"""+Deletes selected warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type WarehouseDelete {warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WarehouseError!]!warehouse: Warehouse}-"""Add shipping zone to given warehouse."""+"""+Add shipping zone to given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type WarehouseShippingZoneAssign {warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WarehouseError!]!warehouse: Warehouse}-"""Remove shipping zone from given warehouse."""+"""+Remove shipping zone from given warehouse. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type WarehouseShippingZoneUnassign {warehouseErrors: [WarehouseError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [WarehouseError!]!warehouse: Warehouse}-"""Creates a new staff notification recipient."""+"""+Creates a new staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+"""type StaffNotificationRecipientCreate {shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShopError!]!@@ -10373,21 +10829,27 @@ input StaffNotificationRecipientInput {active: Boolean}-"""Updates a staff notification recipient."""+"""+Updates a staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+"""type StaffNotificationRecipientUpdate {shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShopError!]!staffNotificationRecipient: StaffNotificationRecipient}-"""Delete staff notification recipient."""+"""+Delete staff notification recipient. Requires one of the following permissions: MANAGE_SETTINGS.+"""type StaffNotificationRecipientDelete {shopErrors: [ShopError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShopError!]!staffNotificationRecipient: StaffNotificationRecipient}-"""Updates site domain of the shop."""+"""+Updates site domain of the shop. Requires one of the following permissions: MANAGE_SETTINGS.+"""type ShopDomainUpdate {"""Updated shop."""shop: Shop@@ -10403,7 +10865,9 @@ input SiteDomainInput {name: String}-"""Updates shop settings."""+"""+Updates shop settings. Requires one of the following permissions: MANAGE_SETTINGS.+"""type ShopSettingsUpdate {"""Updated shop."""shop: Shop@@ -10475,7 +10939,9 @@ input ShopSettingsInput {limitQuantityPerCheckout: Int}-"""Fetch tax rates."""+"""+Fetch tax rates. Requires one of the following permissions: MANAGE_SETTINGS.+"""type ShopFetchTaxRates {"""Updated shop."""shop: Shop@@ -10483,7 +10949,9 @@ type ShopFetchTaxRates {errors: [ShopError!]!}-"""Creates/updates translations for shop settings."""+"""+Creates/updates translations for shop settings. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type ShopSettingsTranslate {"""Updated shop settings."""shop: Shop@@ -10518,7 +10986,7 @@ input ShopSettingsTranslationInput {}"""-Update the shop's address. If the `null` value is passed, the currently selected address will be deleted.+Update the shop's address. If the `null` value is passed, the currently selected address will be deleted. Requires one of the following permissions: MANAGE_SETTINGS."""type ShopAddressUpdate {"""Updated shop."""@@ -10527,7 +10995,9 @@ type ShopAddressUpdate {errors: [ShopError!]!}-"""Update shop order settings."""+"""+Update shop order settings. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderSettingsUpdate {"""Order settings."""orderSettings: OrderSettings@@ -10565,7 +11035,9 @@ input OrderSettingsUpdateInput {automaticallyFulfillNonShippableGiftCard: Boolean}-"""Update gift card settings."""+"""+Update gift card settings. Requires one of the following permissions: MANAGE_GIFT_CARD.+"""type GiftCardSettingsUpdate {"""Gift card settings."""giftCardSettings: GiftCardSettings@@ -10608,7 +11080,9 @@ input TimePeriodInputType {type: TimePeriodTypeEnum!}-"""Manage shipping method's availability in channels."""+"""+Manage shipping method's availability in channels. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingMethodChannelListingUpdate {"""An updated shipping method instance."""shippingMethod: ShippingMethodType@@ -10669,7 +11143,9 @@ input ShippingMethodChannelListingAddInput {maximumOrderPrice: PositiveDecimal}-"""Creates a new shipping price."""+"""+Creates a new shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceCreate {"""A shipping zone to which the shipping method belongs."""shippingZone: ShippingZone@@ -10723,7 +11199,9 @@ input ShippingPostalCodeRulesCreateInputRange {end: String}-"""Deletes a shipping price."""+"""+Deletes a shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceDelete {"""A shipping method to delete."""shippingMethod: ShippingMethodType@@ -10734,7 +11212,9 @@ type ShippingPriceDelete {errors: [ShippingError!]!}-"""Deletes shipping prices."""+"""+Deletes shipping prices. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -10742,7 +11222,9 @@ type ShippingPriceBulkDelete {errors: [ShippingError!]!}-"""Updates a new shipping price."""+"""+Updates a new shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceUpdate {"""A shipping zone to which the shipping method belongs."""shippingZone: ShippingZone@@ -10751,7 +11233,9 @@ type ShippingPriceUpdate {errors: [ShippingError!]!}-"""Creates/updates translations for a shipping method."""+"""+Creates/updates translations for a shipping method. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type ShippingPriceTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!@@ -10765,7 +11249,9 @@ input ShippingPriceTranslationInput {description: JSONString}-"""Exclude products from shipping price."""+"""+Exclude products from shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceExcludeProducts {"""A shipping method with new list of excluded products."""shippingMethod: ShippingMethodType@@ -10778,7 +11264,9 @@ input ShippingPriceExcludeProductsInput {products: [ID!]!}-"""Remove product from excluded list for shipping price."""+"""+Remove product from excluded list for shipping price. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingPriceRemoveProductFromExclude {"""A shipping method with new list of excluded products."""shippingMethod: ShippingMethodType@@ -10786,7 +11274,9 @@ type ShippingPriceRemoveProductFromExclude {errors: [ShippingError!]!}-"""Creates a new shipping zone."""+"""+Creates a new shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingZoneCreate {shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShippingError!]!@@ -10815,14 +11305,18 @@ input ShippingZoneCreateInput {addChannels: [ID!]}-"""Deletes a shipping zone."""+"""+Deletes a shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingZoneDelete {shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShippingError!]!shippingZone: ShippingZone}-"""Deletes shipping zones."""+"""+Deletes shipping zones. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingZoneBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -10830,7 +11324,9 @@ type ShippingZoneBulkDelete {errors: [ShippingError!]!}-"""Updates a new shipping zone."""+"""+Updates a new shipping zone. Requires one of the following permissions: MANAGE_SHIPPING.+"""type ShippingZoneUpdate {shippingErrors: [ShippingError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ShippingError!]!@@ -10865,7 +11361,9 @@ input ShippingZoneUpdateInput {removeChannels: [ID!]}-"""Assign attributes to a given product type."""+"""+Assign attributes to a given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductAttributeAssign {"""The updated product type."""productType: ProductType@@ -10933,7 +11431,7 @@ enum ProductAttributeType {}"""-New in Saleor 3.1. Update attributes assigned to product variant for given product type.+New in Saleor 3.1. Update attributes assigned to product variant for given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES."""type ProductAttributeAssignmentUpdate {"""The updated product type."""@@ -10952,7 +11450,9 @@ input ProductAttributeAssignmentUpdateInput {variantSelection: Boolean!}-"""Un-assign attributes from a given product type."""+"""+Un-assign attributes from a given product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductAttributeUnassign {"""The updated product type."""productType: ProductType@@ -10960,7 +11460,9 @@ type ProductAttributeUnassign {errors: [ProductError!]!}-"""Creates a new category."""+"""+Creates a new category. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CategoryCreate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11000,14 +11502,18 @@ Variables of this type must be set to null in mutations. They will be replaced w"""scalar Upload-"""Deletes a category."""+"""+Deletes a category. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CategoryDelete {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!category: Category}-"""Deletes categories."""+"""+Deletes categories. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CategoryBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11015,14 +11521,18 @@ type CategoryBulkDelete {errors: [ProductError!]!}-"""Updates a category."""+"""+Updates a category. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CategoryUpdate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!category: Category}-"""Creates/updates translations for a category."""+"""+Creates/updates translations for a category. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type CategoryTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!@@ -11036,7 +11546,9 @@ input TranslationInput {description: JSONString}-"""Adds products to a collection."""+"""+Adds products to a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionAddProducts {"""Collection to which products will be added."""collection: Collection@@ -11071,7 +11583,9 @@ enum CollectionErrorCode {CANNOT_MANAGE_PRODUCT_WITHOUT_VARIANT}-"""Creates a new collection."""+"""+Creates a new collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionCreate {collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CollectionError!]!@@ -11107,14 +11621,18 @@ input CollectionCreateInput {products: [ID!]}-"""Deletes a collection."""+"""+Deletes a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionDelete {collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CollectionError!]!collection: Collection}-"""Reorder the products of a collection."""+"""+Reorder the products of a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionReorderProducts {"""Collection from which products are reordered."""collection: Collection@@ -11132,7 +11650,9 @@ input MoveProductInput {sortOrder: Int}-"""Deletes collections."""+"""+Deletes collections. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11140,7 +11660,9 @@ type CollectionBulkDelete {errors: [CollectionError!]!}-"""Remove products from a collection."""+"""+Remove products from a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionRemoveProducts {"""Collection from which products will be removed."""collection: Collection@@ -11148,7 +11670,9 @@ type CollectionRemoveProducts {errors: [CollectionError!]!}-"""Updates a collection."""+"""+Updates a collection. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionUpdate {collectionErrors: [CollectionError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [CollectionError!]!@@ -11181,14 +11705,18 @@ input CollectionInput {publicationDate: Date}-"""Creates/updates translations for a collection."""+"""+Creates/updates translations for a collection. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type CollectionTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!collection: Collection}-"""Manage collection's availability in channels."""+"""+Manage collection's availability in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type CollectionChannelListingUpdate {"""An updated collection instance."""collection: Collection@@ -11237,7 +11765,9 @@ input PublishableChannelListingInput {publicationDate: Date}-"""Creates a new product."""+"""+Creates a new product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductCreate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11313,14 +11843,18 @@ input AttributeValueInput {dateTime: DateTime}-"""Deletes a product."""+"""+Deletes a product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductDelete {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!product: Product}-"""Deletes products."""+"""+Deletes products. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11328,7 +11862,9 @@ type ProductBulkDelete {errors: [ProductError!]!}-"""Updates an existing product."""+"""+Updates an existing product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductUpdate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11370,14 +11906,18 @@ input ProductInput {rating: Float}-"""Creates/updates translations for a product."""+"""+Creates/updates translations for a product. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type ProductTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!product: Product}-"""Manage product's availability in channels."""+"""+Manage product's availability in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductChannelListingUpdate {"""An updated product instance."""product: Product@@ -11449,7 +11989,7 @@ input ProductChannelListingAddInput {}"""-Create a media object (image or video URL) associated with product. For image, 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+Create a media object (image or video URL) associated with product. For image, 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 Requires one of the following permissions: MANAGE_PRODUCTS."""type ProductMediaCreate {product: Product@@ -11473,7 +12013,7 @@ input ProductMediaCreateInput {}"""-Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook.+Reorder the variants of a product. Mutation updates updated_at on product and triggers PRODUCT_UPDATED webhook. Requires one of the following permissions: MANAGE_PRODUCTS."""type ProductVariantReorder {product: Product@@ -11491,7 +12031,9 @@ input ReorderInput {sortOrder: Int}-"""Deletes a product media."""+"""+Deletes a product media. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductMediaDelete {product: Productmedia: ProductMedia@@ -11499,7 +12041,9 @@ type ProductMediaDelete {errors: [ProductError!]!}-"""Deletes product media."""+"""+Deletes product media. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductMediaBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11507,7 +12051,9 @@ type ProductMediaBulkDelete {errors: [ProductError!]!}-"""Changes ordering of the product media."""+"""+Changes ordering of the product media. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductMediaReorder {product: Productmedia: [ProductMedia!]@@ -11515,7 +12061,9 @@ type ProductMediaReorder {errors: [ProductError!]!}-"""Updates a product media."""+"""+Updates a product media. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductMediaUpdate {product: Productmedia: ProductMedia@@ -11528,7 +12076,9 @@ input ProductMediaUpdateInput {alt: String}-"""Creates a new product type."""+"""+Creates a new product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductTypeCreate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11571,14 +12121,18 @@ input ProductTypeInput {taxCode: String}-"""Deletes a product type."""+"""+Deletes a product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductTypeDelete {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!productType: ProductType}-"""Deletes product types."""+"""+Deletes product types. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductTypeBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11586,14 +12140,18 @@ type ProductTypeBulkDelete {errors: [ProductError!]!}-"""Updates an existing product type."""+"""+Updates an existing product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductTypeUpdate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!productType: ProductType}-"""Reorder the attributes of a product type."""+"""+Reorder the attributes of a product type. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type ProductTypeReorderAttributes {"""Product type from which attributes are reordered."""productType: ProductType@@ -11601,7 +12159,9 @@ type ProductTypeReorderAttributes {errors: [ProductError!]!}-"""Reorder product attribute values."""+"""+Reorder product attribute values. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductReorderAttributeValues {"""Product from which attribute values are reordered."""product: Product@@ -11685,7 +12245,9 @@ input DigitalContentUrlCreateInput {content: ID!}-"""Creates a new variant for a product."""+"""+Creates a new variant for a product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantCreate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11740,14 +12302,18 @@ input StockInput {quantity: Int!}-"""Deletes a product variant."""+"""+Deletes a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantDelete {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!productVariant: ProductVariant}-"""Creates product variants for a given product."""+"""+Creates product variants for a given product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantBulkCreate {"""Returns how many objects were created."""count: Int!@@ -11849,7 +12415,9 @@ input ProductVariantChannelListingAddInput {preorderThreshold: Int}-"""Deletes product variants."""+"""+Deletes product variants. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -11857,7 +12425,9 @@ type ProductVariantBulkDelete {errors: [ProductError!]!}-"""Creates stocks for product variant."""+"""+Creates stocks for product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantStocksCreate {"""Updated product variant."""productVariant: ProductVariant@@ -11887,7 +12457,9 @@ type BulkStockError {index: Int}-"""Delete stocks from product variant."""+"""+Delete stocks from product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantStocksDelete {"""Updated product variant."""productVariant: ProductVariant@@ -11918,7 +12490,9 @@ enum StockErrorCode {UNIQUE}-"""Update stocks for product variant."""+"""+Update stocks for product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantStocksUpdate {"""Updated product variant."""productVariant: ProductVariant@@ -11926,7 +12500,9 @@ type ProductVariantStocksUpdate {errors: [BulkStockError!]!}-"""Updates an existing variant for product."""+"""+Updates an existing variant for product. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantUpdate {productErrors: [ProductError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ProductError!]!@@ -11960,7 +12536,7 @@ input ProductVariantInput {}"""-Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook.+Set default variant for a product. Mutation triggers PRODUCT_UPDATED webhook. Requires one of the following permissions: MANAGE_PRODUCTS."""type ProductVariantSetDefault {product: Product@@ -11968,7 +12544,9 @@ type ProductVariantSetDefault {errors: [ProductError!]!}-"""Creates/updates translations for a product variant."""+"""+Creates/updates translations for a product variant. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type ProductVariantTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!@@ -11979,7 +12557,9 @@ input NameTranslationInput {name: String}-"""Manage product variant prices in channels."""+"""+Manage product variant prices in channels. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantChannelListingUpdate {"""An updated product variant instance."""variant: ProductVariant@@ -11987,7 +12567,9 @@ type ProductVariantChannelListingUpdate {errors: [ProductChannelListingError!]!}-"""Reorder product variant attribute values."""+"""+Reorder product variant attribute values. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ProductVariantReorderAttributeValues {"""Product variant from which attribute values are reordered."""productVariant: ProductVariant@@ -11996,7 +12578,7 @@ type ProductVariantReorderAttributeValues {}"""-New in Saleor 3.1. Deactivates product variant preorder. It changes all preorder allocation into regular allocation. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Deactivates product variant preorder. It changes all preorder allocation into regular allocation. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_PRODUCTS."""type ProductVariantPreorderDeactivate {"""Product variant with ended preorder."""@@ -12004,7 +12586,9 @@ type ProductVariantPreorderDeactivate {errors: [ProductError!]!}-"""Assign an media to a product variant."""+"""+Assign an media to a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type VariantMediaAssign {productVariant: ProductVariantmedia: ProductMedia@@ -12012,7 +12596,9 @@ type VariantMediaAssign {errors: [ProductError!]!}-"""Unassign an media from a product variant."""+"""+Unassign an media from a product variant. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type VariantMediaUnassign {productVariant: ProductVariantmedia: ProductMedia@@ -12020,7 +12606,9 @@ type VariantMediaUnassign {errors: [ProductError!]!}-"""Captures the authorized payment amount."""+"""+Captures the authorized payment amount. Requires one of the following permissions: MANAGE_ORDERS.+"""type PaymentCapture {"""Updated payment."""payment: Payment@@ -12065,7 +12653,9 @@ enum PaymentErrorCode {NO_CHECKOUT_LINES}-"""Refunds the captured payment amount."""+"""+Refunds the captured payment amount. Requires one of the following permissions: MANAGE_ORDERS.+"""type PaymentRefund {"""Updated payment."""payment: Payment@@ -12073,7 +12663,9 @@ type PaymentRefund {errors: [PaymentError!]!}-"""Voids the authorized payment."""+"""+Voids the authorized payment. Requires one of the following permissions: MANAGE_ORDERS.+"""type PaymentVoid {"""Updated payment."""payment: Payment@@ -12145,7 +12737,9 @@ input MoneyInput {amount: PositiveDecimal!}-"""Creates a new page."""+"""+Creates a new page. Requires one of the following permissions: MANAGE_PAGES.+"""type PageCreate {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!@@ -12208,14 +12802,18 @@ input PageCreateInput {pageType: ID!}-"""Deletes a page."""+"""+Deletes a page. Requires one of the following permissions: MANAGE_PAGES.+"""type PageDelete {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!page: Page}-"""Deletes pages."""+"""+Deletes pages. Requires one of the following permissions: MANAGE_PAGES.+"""type PageBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -12223,7 +12821,9 @@ type PageBulkDelete {errors: [PageError!]!}-"""Publish pages."""+"""+Publish pages. Requires one of the following permissions: MANAGE_PAGES.+"""type PageBulkPublish {"""Returns how many objects were affected."""count: Int!@@ -12231,7 +12831,9 @@ type PageBulkPublish {errors: [PageError!]!}-"""Updates an existing page."""+"""+Updates an existing page. Requires one of the following permissions: MANAGE_PAGES.+"""type PageUpdate {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!@@ -12261,7 +12863,9 @@ input PageInput {seo: SeoInput}-"""Creates/updates translations for a page."""+"""+Creates/updates translations for a page. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type PageTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!@@ -12275,7 +12879,9 @@ input PageTranslationInput {content: JSONString}-"""Create a new page type."""+"""+Create a new page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageTypeCreate {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!@@ -12293,7 +12899,9 @@ input PageTypeCreateInput {addAttributes: [ID!]}-"""Update page type."""+"""+Update page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageTypeUpdate {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!@@ -12314,14 +12922,18 @@ input PageTypeUpdateInput {removeAttributes: [ID!]}-"""Delete a page type."""+"""+Delete a page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageTypeDelete {pageErrors: [PageError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PageError!]!pageType: PageType}-"""Delete page types."""+"""+Delete page types. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageTypeBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -12329,7 +12941,9 @@ type PageTypeBulkDelete {errors: [PageError!]!}-"""Assign attributes to a given page type."""+"""+Assign attributes to a given page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageAttributeAssign {"""The updated page type."""pageType: PageType@@ -12337,7 +12951,9 @@ type PageAttributeAssign {errors: [PageError!]!}-"""Unassign attributes from a given page type."""+"""+Unassign attributes from a given page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageAttributeUnassign {"""The updated page type."""pageType: PageType@@ -12345,7 +12961,9 @@ type PageAttributeUnassign {errors: [PageError!]!}-"""Reorder the attributes of a page type."""+"""+Reorder the attributes of a page type. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type PageTypeReorderAttributes {"""Page type from which attributes are reordered."""pageType: PageType@@ -12353,7 +12971,9 @@ type PageTypeReorderAttributes {errors: [PageError!]!}-"""Reorder page attribute values."""+"""+Reorder page attribute values. Requires one of the following permissions: MANAGE_PAGES.+"""type PageReorderAttributeValues {"""Page from which attribute values are reordered."""page: Page@@ -12361,7 +12981,9 @@ type PageReorderAttributeValues {errors: [PageError!]!}-"""Completes creating an order."""+"""+Completes creating an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderComplete {"""Completed order."""order: Order@@ -12369,7 +12991,9 @@ type DraftOrderComplete {errors: [OrderError!]!}-"""Creates a new draft order."""+"""+Creates a new draft order. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderCreate {orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [OrderError!]!@@ -12421,14 +13045,18 @@ input OrderLineCreateInput {variantId: ID!}-"""Deletes a draft order."""+"""+Deletes a draft order. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderDelete {orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [OrderError!]!order: Order}-"""Deletes draft orders."""+"""+Deletes draft orders. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -12436,7 +13064,9 @@ type DraftOrderBulkDelete {errors: [OrderError!]!}-"""Deletes order lines."""+"""+Deletes order lines. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderLinesBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -12444,7 +13074,9 @@ type DraftOrderLinesBulkDelete {errors: [OrderError!]!}-"""Updates a draft order."""+"""+Updates a draft order. Requires one of the following permissions: MANAGE_ORDERS.+"""type DraftOrderUpdate {orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [OrderError!]!@@ -12485,7 +13117,9 @@ input DraftOrderInput {redirectUrl: String}-"""Adds note to the order."""+"""+Adds note to the order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderAddNote {"""Order with the note added."""order: Order@@ -12501,7 +13135,9 @@ input OrderAddNoteInput {message: String!}-"""Cancel an order."""+"""+Cancel an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderCancel {"""Canceled order."""order: Order@@ -12509,7 +13145,9 @@ type OrderCancel {errors: [OrderError!]!}-"""Capture an order."""+"""+Capture an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderCapture {"""Captured order."""order: Order@@ -12517,14 +13155,18 @@ type OrderCapture {errors: [OrderError!]!}-"""Confirms an unconfirmed order by changing status to unfulfilled."""+"""+Confirms an unconfirmed order by changing status to unfulfilled. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderConfirm {order: OrderorderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [OrderError!]!}-"""Creates new fulfillments for an order."""+"""+Creates new fulfillments for an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderFulfill {"""List of created fulfillments."""fulfillments: [Fulfillment!]@@ -12562,7 +13204,9 @@ input OrderFulfillStockInput {warehouse: ID!}-"""Cancels existing fulfillment and optionally restocks items."""+"""+Cancels existing fulfillment and optionally restocks items. Requires one of the following permissions: MANAGE_ORDERS.+"""type FulfillmentCancel {"""A canceled fulfillment."""fulfillment: Fulfillment@@ -12580,7 +13224,9 @@ input FulfillmentCancelInput {warehouseId: ID}-"""New in Saleor 3.1. Approve existing fulfillment."""+"""+New in Saleor 3.1. Approve existing fulfillment. Requires one of the following permissions: MANAGE_ORDERS.+"""type FulfillmentApprove {"""An approved fulfillment."""fulfillment: Fulfillment@@ -12591,7 +13237,9 @@ type FulfillmentApprove {errors: [OrderError!]!}-"""Updates a fulfillment for an order."""+"""+Updates a fulfillment for an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type FulfillmentUpdateTracking {"""A fulfillment with updated tracking."""fulfillment: Fulfillment@@ -12610,7 +13258,9 @@ input FulfillmentUpdateTrackingInput {notifyCustomer: Boolean = false}-"""Refund products."""+"""+Refund products. Requires one of the following permissions: MANAGE_ORDERS.+"""type FulfillmentRefundProducts {"""A refunded fulfillment."""fulfillment: Fulfillment@@ -12653,7 +13303,9 @@ input OrderRefundFulfillmentLineInput {quantity: Int!}-"""Return products."""+"""+Return products. Requires one of the following permissions: MANAGE_ORDERS.+"""type FulfillmentReturnProducts {"""A return fulfillment."""returnFulfillment: Fulfillment@@ -12711,7 +13363,9 @@ input OrderReturnFulfillmentLineInput {replace: Boolean = false}-"""Create order lines for an order."""+"""+Create order lines for an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderLinesCreate {"""Related order."""order: Order@@ -12722,7 +13376,9 @@ type OrderLinesCreate {errors: [OrderError!]!}-"""Deletes an order line from an order."""+"""+Deletes an order line from an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderLineDelete {"""A related order."""order: Order@@ -12733,7 +13389,9 @@ type OrderLineDelete {errors: [OrderError!]!}-"""Updates an order line of an order."""+"""+Updates an order line of an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderLineUpdate {"""Related order."""order: Order@@ -12747,7 +13405,9 @@ input OrderLineInput {quantity: Int!}-"""Adds discount to the order."""+"""+Adds discount to the order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderDiscountAdd {"""Order which has been discounted."""order: Order@@ -12766,7 +13426,9 @@ input OrderDiscountCommonInput {reason: String}-"""Update discount for the order."""+"""+Update discount for the order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderDiscountUpdate {"""Order which has been discounted."""order: Order@@ -12774,7 +13436,9 @@ type OrderDiscountUpdate {errors: [OrderError!]!}-"""Remove discount from the order."""+"""+Remove discount from the order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderDiscountDelete {"""Order which has removed discount."""order: Order@@ -12782,7 +13446,9 @@ type OrderDiscountDelete {errors: [OrderError!]!}-"""Update discount for the order line."""+"""+Update discount for the order line. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderLineDiscountUpdate {"""Order line which has been discounted."""orderLine: OrderLine@@ -12793,7 +13459,9 @@ type OrderLineDiscountUpdate {errors: [OrderError!]!}-"""Remove discount applied to the order line."""+"""+Remove discount applied to the order line. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderLineDiscountRemove {"""Order line which has removed discount."""orderLine: OrderLine@@ -12804,7 +13472,9 @@ type OrderLineDiscountRemove {errors: [OrderError!]!}-"""Mark order as manually paid."""+"""+Mark order as manually paid. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderMarkAsPaid {"""Order marked as paid."""order: Order@@ -12812,7 +13482,9 @@ type OrderMarkAsPaid {errors: [OrderError!]!}-"""Refund an order."""+"""+Refund an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderRefund {"""A refunded order."""order: Order@@ -12820,7 +13492,9 @@ type OrderRefund {errors: [OrderError!]!}-"""Updates an order."""+"""+Updates an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderUpdate {orderErrors: [OrderError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [OrderError!]!@@ -12839,7 +13513,7 @@ input OrderUpdateInput {}"""-Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed.+Updates a shipping method of the order. Requires shipping method ID to update, when null is passed then currently assigned shipping method is removed. Requires one of the following permissions: MANAGE_ORDERS."""type OrderUpdateShipping {"""Order with updated shipping method."""@@ -12855,7 +13529,9 @@ input OrderUpdateShippingInput {shippingMethod: ID}-"""Void an order."""+"""+Void an order. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderVoid {"""A voided order."""order: Order@@ -12863,7 +13539,9 @@ type OrderVoid {errors: [OrderError!]!}-"""Cancels orders."""+"""+Cancels orders. Requires one of the following permissions: MANAGE_ORDERS.+"""type OrderBulkCancel {"""Returns how many objects were affected."""count: Int!@@ -12871,7 +13549,9 @@ type OrderBulkCancel {errors: [OrderError!]!}-"""Delete metadata of an object."""+"""+Delete metadata of an object. To use it, you need to have access to the modified object.+"""type DeleteMetadata {metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MetadataError!]!@@ -12900,14 +13580,18 @@ enum MetadataErrorCode {NOT_UPDATED}-"""Delete object's private metadata."""+"""+Delete object's private metadata. To use it, you need to be an authenticated staff user or an app and have access to the modified object.+"""type DeletePrivateMetadata {metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MetadataError!]!item: ObjectWithMetadata}-"""Updates metadata of an object."""+"""+Updates metadata of an object. To use it, you need to have access to the modified object.+"""type UpdateMetadata {metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MetadataError!]!@@ -12922,14 +13606,18 @@ input MetadataInput {value: String!}-"""Updates private metadata of an object."""+"""+Updates private metadata of an object. To use it, you need to be an authenticated staff user or an app and have access to the modified object.+"""type UpdatePrivateMetadata {metadataErrors: [MetadataError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MetadataError!]!item: ObjectWithMetadata}-"""Assigns storefront's navigation menus."""+"""+Assigns storefront's navigation menus. Requires one of the following permissions: MANAGE_MENUS, MANAGE_SETTINGS.+"""type AssignNavigation {"""Assigned navigation menu."""menu: Menu@@ -12971,7 +13659,9 @@ enum NavigationType {SECONDARY}-"""Creates a new Menu."""+"""+Creates a new Menu. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuCreate {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!@@ -13006,14 +13696,18 @@ input MenuItemInput {page: ID}-"""Deletes a menu."""+"""+Deletes a menu. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuDelete {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!menu: Menu}-"""Deletes menus."""+"""+Deletes menus. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -13021,7 +13715,9 @@ type MenuBulkDelete {errors: [MenuError!]!}-"""Updates a menu."""+"""+Updates a menu. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuUpdate {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!@@ -13036,7 +13732,9 @@ input MenuInput {slug: String}-"""Creates a new menu item."""+"""+Creates a new menu item. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuItemCreate {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!@@ -13066,14 +13764,18 @@ input MenuItemCreateInput {parent: ID}-"""Deletes a menu item."""+"""+Deletes a menu item. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuItemDelete {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!menuItem: MenuItem}-"""Deletes menu items."""+"""+Deletes menu items. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuItemBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -13081,21 +13783,27 @@ type MenuItemBulkDelete {errors: [MenuError!]!}-"""Updates a menu item."""+"""+Updates a menu item. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuItemUpdate {menuErrors: [MenuError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [MenuError!]!menuItem: MenuItem}-"""Creates/updates translations for a menu item."""+"""+Creates/updates translations for a menu item. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type MenuItemTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!menuItem: MenuItem}-"""Moves items of menus."""+"""+Moves items of menus. Requires one of the following permissions: MANAGE_MENUS.+"""type MenuItemMove {"""Assigned menu to move within."""menu: Menu@@ -13116,7 +13824,9 @@ input MenuItemMoveInput {sortOrder: Int}-"""Request an invoice for the order using plugin."""+"""+Request an invoice for the order using plugin. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceRequest {"""Order related to an invoice."""order: Order@@ -13150,14 +13860,18 @@ enum InvoiceErrorCode {NO_INVOICE_PLUGIN}-"""Requests deletion of an invoice."""+"""+Requests deletion of an invoice. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceRequestDelete {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice}-"""Creates a ready to send invoice."""+"""+Creates a ready to send invoice. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceCreate {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!@@ -13172,14 +13886,18 @@ input InvoiceCreateInput {url: String!}-"""Deletes an invoice."""+"""+Deletes an invoice. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceDelete {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice}-"""Updates an invoice."""+"""+Updates an invoice. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceUpdate {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!@@ -13194,14 +13912,18 @@ input UpdateInvoiceInput {url: String}-"""Send an invoice notification to the customer."""+"""+Send an invoice notification to the customer. Requires one of the following permissions: MANAGE_ORDERS.+"""type InvoiceSendNotification {invoiceErrors: [InvoiceError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [InvoiceError!]!invoice: Invoice}-"""Activate a gift card."""+"""+Activate a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+"""type GiftCardActivate {"""Activated gift card."""giftCard: GiftCard@@ -13237,7 +13959,9 @@ enum GiftCardErrorCode {DUPLICATED_INPUT_ITEM}-"""Creates a new gift card."""+"""+Creates a new gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+"""type GiftCardCreate {giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [GiftCardError!]!@@ -13307,7 +14031,7 @@ input PriceInput {}"""-New in Saleor 3.1. Delete gift card. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Delete gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardDelete {giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -13315,7 +14039,9 @@ type GiftCardDelete {giftCard: GiftCard}-"""Deactivate a gift card."""+"""+Deactivate a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+"""type GiftCardDeactivate {"""Deactivated gift card."""giftCard: GiftCard@@ -13323,7 +14049,9 @@ type GiftCardDeactivate {errors: [GiftCardError!]!}-"""Update a gift card."""+"""+Update a gift card. Requires one of the following permissions: MANAGE_GIFT_CARD.+"""type GiftCardUpdate {giftCardErrors: [GiftCardError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [GiftCardError!]!@@ -13367,7 +14095,7 @@ input GiftCardUpdateInput {}"""-New in Saleor 3.1. Resend a gift card. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Resend a gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardResend {"""Gift card which has been sent."""@@ -13387,7 +14115,7 @@ input GiftCardResendInput {}"""-New in Saleor 3.1. Adds note to the gift card. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Adds note to the gift card. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardAddNote {"""Gift card with the note added."""@@ -13404,7 +14132,7 @@ input GiftCardAddNoteInput {}"""-New in Saleor 3.1. Create gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Create gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardBulkCreate {"""Returns how many objects were created."""@@ -13433,7 +14161,7 @@ input GiftCardBulkCreateInput {}"""-New in Saleor 3.1. Delete gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Delete gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardBulkDelete {"""Returns how many objects were affected."""@@ -13442,7 +14170,7 @@ type GiftCardBulkDelete {}"""-New in Saleor 3.1. Activate gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Activate gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardBulkActivate {"""Returns how many objects were affected."""@@ -13451,7 +14179,7 @@ type GiftCardBulkActivate {}"""-New in Saleor 3.1. Deactivate gift cards. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Deactivate gift cards. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type GiftCardBulkDeactivate {"""Returns how many objects were affected."""@@ -13459,7 +14187,9 @@ type GiftCardBulkDeactivate {errors: [GiftCardError!]!}-"""Update plugin configuration."""+"""+Update plugin configuration. Requires one of the following permissions: MANAGE_PLUGINS.+"""type PluginUpdate {plugin: PluginpluginsErrors: [PluginError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -13550,7 +14280,9 @@ input ExternalNotificationTriggerInput {externalEventType: String!}-"""Creates a new sale."""+"""+Creates a new sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleCreate {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!@@ -13615,14 +14347,18 @@ input SaleInput {endDate: DateTime}-"""Deletes a sale."""+"""+Deletes a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleDelete {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!sale: Sale}-"""Deletes sales."""+"""+Deletes sales. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -13630,14 +14366,18 @@ type SaleBulkDelete {errors: [DiscountError!]!}-"""Updates a sale."""+"""+Updates a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleUpdate {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!sale: Sale}-"""Adds products, categories, collections to a voucher."""+"""+Adds products, categories, collections to a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleAddCatalogues {"""Sale of which catalogue IDs will be modified."""sale: Sale@@ -13659,7 +14399,9 @@ input CatalogueInput {variants: [ID!]}-"""Removes products, categories, collections from a sale."""+"""+Removes products, categories, collections from a sale. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleRemoveCatalogues {"""Sale of which catalogue IDs will be modified."""sale: Sale@@ -13667,14 +14409,18 @@ type SaleRemoveCatalogues {errors: [DiscountError!]!}-"""Creates/updates translations for a sale."""+"""+Creates/updates translations for a sale. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type SaleTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!sale: Sale}-"""Manage sale's availability in channels."""+"""+Manage sale's availability in channels. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type SaleChannelListingUpdate {"""An updated sale instance."""sale: Sale@@ -13698,7 +14444,9 @@ input SaleChannelListingAddInput {discountValue: PositiveDecimal!}-"""Creates a new voucher."""+"""+Creates a new voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherCreate {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!@@ -13755,14 +14503,18 @@ input VoucherInput {usageLimit: Int}-"""Deletes a voucher."""+"""+Deletes a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherDelete {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!voucher: Voucher}-"""Deletes vouchers."""+"""+Deletes vouchers. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -13770,14 +14522,18 @@ type VoucherBulkDelete {errors: [DiscountError!]!}-"""Updates a voucher."""+"""+Updates a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherUpdate {discountErrors: [DiscountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [DiscountError!]!voucher: Voucher}-"""Adds products, categories, collections to a voucher."""+"""+Adds products, categories, collections to a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherAddCatalogues {"""Voucher of which catalogue IDs will be modified."""voucher: Voucher@@ -13785,7 +14541,9 @@ type VoucherAddCatalogues {errors: [DiscountError!]!}-"""Removes products, categories, collections from a voucher."""+"""+Removes products, categories, collections from a voucher. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherRemoveCatalogues {"""Voucher of which catalogue IDs will be modified."""voucher: Voucher@@ -13793,14 +14551,18 @@ type VoucherRemoveCatalogues {errors: [DiscountError!]!}-"""Creates/updates translations for a voucher."""+"""+Creates/updates translations for a voucher. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type VoucherTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!voucher: Voucher}-"""Manage voucher's availability in channels."""+"""+Manage voucher's availability in channels. Requires one of the following permissions: MANAGE_DISCOUNTS.+"""type VoucherChannelListingUpdate {"""An updated voucher instance."""voucher: Voucher@@ -13827,7 +14589,9 @@ input VoucherChannelListingAddInput {minAmountSpent: PositiveDecimal}-"""Export products to csv file."""+"""+Export products to csv file. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type ExportProducts {"""The newly created export file job which is responsible for export data.@@ -13922,7 +14686,7 @@ enum FileTypesEnum {}"""-New in Saleor 3.1. Export gift cards to csv file. Note: this feature is in a preview state and can be subject to changes at later point.+New in Saleor 3.1. Export gift cards to csv file. Note: this feature is in a preview state and can be subject to changes at later point. Requires one of the following permissions: MANAGE_GIFT_CARD."""type ExportGiftCards {"""@@ -14103,7 +14867,9 @@ input CheckoutLineInput {variantId: ID!}-"""Sets the customer as the owner of the checkout."""+"""+Sets the customer as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.+"""type CheckoutCustomerAttach {"""An updated checkout."""checkout: Checkout@@ -14111,7 +14877,9 @@ type CheckoutCustomerAttach {errors: [CheckoutError!]!}-"""Removes the user assigned as the owner of the checkout."""+"""+Removes the user assigned as the owner of the checkout. Requires one of the following permissions: AUTHENTICATED_APP, AUTHENTICATED_USER.+"""type CheckoutCustomerDetach {"""An updated checkout."""checkout: Checkout@@ -14254,7 +15022,9 @@ type CheckoutLanguageCodeUpdate {errors: [CheckoutError!]!}-"""Creates new channel."""+"""+Creates new channel. Requires one of the following permissions: MANAGE_CHANNELS.+"""type ChannelCreate {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ChannelError!]!@@ -14312,7 +15082,9 @@ input ChannelCreateInput {addShippingZones: [ID!]}-"""Update a channel."""+"""+Update a channel. Requires one of the following permissions: MANAGE_CHANNELS.+"""type ChannelUpdate {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [ChannelError!]!@@ -14342,7 +15114,7 @@ input ChannelUpdateInput {}"""-Delete a channel. Orders associated with the deleted channel will be moved to the target channel. Checkouts, product availability, and pricing will be removed.+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."""type ChannelDelete {channelErrors: [ChannelError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -14355,7 +15127,9 @@ input ChannelDeleteInput {channelId: ID!}-"""Activate a channel."""+"""+Activate a channel. Requires one of the following permissions: MANAGE_CHANNELS.+"""type ChannelActivate {"""Activated channel."""channel: Channel@@ -14363,7 +15137,9 @@ type ChannelActivate {errors: [ChannelError!]!}-"""Deactivate a channel."""+"""+Deactivate a channel. Requires one of the following permissions: MANAGE_CHANNELS.+"""type ChannelDeactivate {"""Deactivated channel."""channel: Channel@@ -14466,14 +15242,18 @@ input AttributeValueCreateInput {name: String!}-"""Deletes an attribute."""+"""+Deletes an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type AttributeDelete {attributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AttributeError!]!attribute: Attribute}-"""Updates attribute."""+"""+Updates attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type AttributeUpdate {attribute: AttributeattributeErrors: [AttributeError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -14539,14 +15319,18 @@ input AttributeValueUpdateInput {name: String}-"""Creates/updates translations for an attribute."""+"""+Creates/updates translations for an attribute. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type AttributeTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!attribute: Attribute}-"""Deletes attributes."""+"""+Deletes attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type AttributeBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -14554,7 +15338,9 @@ type AttributeBulkDelete {errors: [AttributeError!]!}-"""Deletes values of attributes."""+"""+Deletes values of attributes. Requires one of the following permissions: MANAGE_PAGE_TYPES_AND_ATTRIBUTES.+"""type AttributeValueBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -14562,7 +15348,9 @@ type AttributeValueBulkDelete {errors: [AttributeError!]!}-"""Creates a value for an attribute."""+"""+Creates a value for an attribute. Requires one of the following permissions: MANAGE_PRODUCTS.+"""type AttributeValueCreate {"""The updated attribute."""attribute: Attribute@@ -14571,7 +15359,9 @@ type AttributeValueCreate {attributeValue: AttributeValue}-"""Deletes a value of an attribute."""+"""+Deletes a value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type AttributeValueDelete {"""The updated attribute."""attribute: Attribute@@ -14580,7 +15370,9 @@ type AttributeValueDelete {attributeValue: AttributeValue}-"""Updates value of an attribute."""+"""+Updates value of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type AttributeValueUpdate {"""The updated attribute."""attribute: Attribute@@ -14589,7 +15381,9 @@ type AttributeValueUpdate {attributeValue: AttributeValue}-"""Creates/updates translations for an attribute value."""+"""+Creates/updates translations for an attribute value. Requires one of the following permissions: MANAGE_TRANSLATIONS.+"""type AttributeValueTranslate {translationErrors: [TranslationError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [TranslationError!]!@@ -14601,7 +15395,9 @@ input AttributeValueTranslationInput {richText: JSONString}-"""Reorder the values of an attribute."""+"""+Reorder the values of an attribute. Requires one of the following permissions: MANAGE_PRODUCT_TYPES_AND_ATTRIBUTES.+"""type AttributeReorderValues {"""Attribute from which values are reordered."""attribute: Attribute@@ -14609,7 +15405,9 @@ type AttributeReorderValues {errors: [AttributeError!]!}-"""Creates a new app."""+"""+Creates a new app. Requires one of the following permissions: MANAGE_APPS.+"""type AppCreate {"""The newly created authentication token."""authToken: String@@ -14659,21 +15457,27 @@ input AppInput {permissions: [PermissionEnum!]}-"""Updates an existing app."""+"""+Updates an existing app. Requires one of the following permissions: MANAGE_APPS.+"""type AppUpdate {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App}-"""Deletes an app."""+"""+Deletes an app. Requires one of the following permissions: MANAGE_APPS.+"""type AppDelete {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App}-"""Creates a new token."""+"""+Creates a new token. Requires one of the following permissions: MANAGE_APPS.+"""type AppTokenCreate {"""The newly created authentication token."""authToken: String@@ -14690,7 +15494,9 @@ input AppTokenInput {app: ID!}-"""Deletes an authentication token assigned to app."""+"""+Deletes an authentication token assigned to app. Requires one of the following permissions: MANAGE_APPS.+"""type AppTokenDelete {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!@@ -14705,7 +15511,9 @@ type AppTokenVerify {errors: [AppError!]!}-"""Install new app by using app manifest."""+"""+Install new app by using app manifest. Requires one of the following permissions: MANAGE_APPS.+"""type AppInstall {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!@@ -14726,21 +15534,27 @@ input AppInstallInput {permissions: [PermissionEnum!]}-"""Retry failed installation of new app."""+"""+Retry failed installation of new app. Requires one of the following permissions: MANAGE_APPS.+"""type AppRetryInstall {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!appInstallation: AppInstallation}-"""Delete failed installation."""+"""+Delete failed installation. Requires one of the following permissions: MANAGE_APPS.+"""type AppDeleteFailedInstallation {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!appInstallation: AppInstallation}-"""Fetch and validate manifest."""+"""+Fetch and validate manifest. Requires one of the following permissions: MANAGE_APPS.+"""type AppFetchManifest {manifest: ManifestappErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")@@ -14781,14 +15595,18 @@ type AppManifestExtension {target: AppExtensionTargetEnum!}-"""Activate the app."""+"""+Activate the app. Requires one of the following permissions: MANAGE_APPS.+"""type AppActivate {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!app: App}-"""Deactivate the app."""+"""+Deactivate the app. Requires one of the following permissions: MANAGE_APPS.+"""type AppDeactivate {appErrors: [AppError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AppError!]!@@ -14899,7 +15717,9 @@ String, Boolean, Int, Float, List or Object."""scalar GenericScalar-"""Deactivate all JWT tokens of the currently authenticated user."""+"""+Deactivate all JWT tokens of the currently authenticated user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type DeactivateAllUserTokens {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!@@ -15002,7 +15822,9 @@ type SetPassword {errors: [AccountError!]!}-"""Change the password of the logged in user."""+"""+Change the password of the logged in user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type PasswordChange {"""A user instance with a new password."""user: User@@ -15010,7 +15832,9 @@ type PasswordChange {errors: [AccountError!]!}-"""Request email change of the logged in user."""+"""+Request email change of the logged in user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type RequestEmailChange {"""A user instance."""user: User@@ -15018,7 +15842,9 @@ type RequestEmailChange {errors: [AccountError!]!}-"""Confirm the email change of the logged-in user."""+"""+Confirm the email change of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type ConfirmEmailChange {"""A user instance with a new email."""user: User@@ -15026,7 +15852,9 @@ type ConfirmEmailChange {errors: [AccountError!]!}-"""Create a new address for the customer."""+"""+Create a new address for the customer. Requires one of the following permissions: AUTHENTICATED_USER.+"""type AccountAddressCreate {"""A user instance for which the address was created."""user: User@@ -15035,7 +15863,9 @@ type AccountAddressCreate {address: Address}-"""Updates an address of the logged-in user."""+"""+Updates an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.+"""type AccountAddressUpdate {"""A user object for which the address was edited."""user: User@@ -15044,7 +15874,9 @@ type AccountAddressUpdate {address: Address}-"""Delete an address of the logged-in user."""+"""+Delete an address of the logged-in user. Requires one of the following permissions: MANAGE_USERS, IS_OWNER.+"""type AccountAddressDelete {"""A user instance for which the address was deleted."""user: User@@ -15053,7 +15885,9 @@ type AccountAddressDelete {address: Address}-"""Sets a default address for the authenticated user."""+"""+Sets a default address for the authenticated user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type AccountSetDefaultAddress {"""An updated user instance."""user: User@@ -15098,7 +15932,9 @@ input AccountRegisterInput {channel: String}-"""Updates the account of the logged-in user."""+"""+Updates the account of the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type AccountUpdate {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!@@ -15122,20 +15958,26 @@ input AccountInput {defaultShippingAddress: AddressInput}-"""Sends an email with the account removal link for the logged-in user."""+"""+Sends an email with the account removal link for the logged-in user. Requires one of the following permissions: AUTHENTICATED_USER.+"""type AccountRequestDeletion {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!}-"""Remove user account."""+"""+Remove user account. Requires one of the following permissions: AUTHENTICATED_USER.+"""type AccountDelete {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User}-"""Creates user address."""+"""+Creates user address. Requires one of the following permissions: MANAGE_USERS.+"""type AddressCreate {"""A user instance for which the address was created."""user: User@@ -15144,7 +15986,9 @@ type AddressCreate {address: Address}-"""Updates an address."""+"""+Updates an address. Requires one of the following permissions: MANAGE_USERS.+"""type AddressUpdate {"""A user object for which the address was edited."""user: User@@ -15153,7 +15997,9 @@ type AddressUpdate {address: Address}-"""Deletes an address."""+"""+Deletes an address. Requires one of the following permissions: MANAGE_USERS.+"""type AddressDelete {"""A user instance for which the address was deleted."""user: User@@ -15162,7 +16008,9 @@ type AddressDelete {address: Address}-"""Sets a default address for the given user."""+"""+Sets a default address for the given user. Requires one of the following permissions: MANAGE_USERS.+"""type AddressSetDefault {"""An updated user instance."""user: User@@ -15170,7 +16018,9 @@ type AddressSetDefault {errors: [AccountError!]!}-"""Creates a new customer."""+"""+Creates a new customer. Requires one of the following permissions: MANAGE_USERS.+"""type CustomerCreate {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!@@ -15213,7 +16063,9 @@ input UserCreateInput {channel: String}-"""Updates an existing customer."""+"""+Updates an existing customer. Requires one of the following permissions: MANAGE_USERS.+"""type CustomerUpdate {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!@@ -15246,14 +16098,18 @@ input CustomerInput {languageCode: LanguageCodeEnum}-"""Deletes a customer."""+"""+Deletes a customer. Requires one of the following permissions: MANAGE_USERS.+"""type CustomerDelete {accountErrors: [AccountError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [AccountError!]!user: User}-"""Deletes customers."""+"""+Deletes customers. Requires one of the following permissions: MANAGE_USERS.+"""type CustomerBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -15261,7 +16117,9 @@ type CustomerBulkDelete {errors: [AccountError!]!}-"""Creates a new staff user."""+"""+Creates a new staff user. Requires one of the following permissions: MANAGE_STAFF.+"""type StaffCreate {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!@@ -15318,7 +16176,9 @@ input StaffCreateInput {redirectUrl: String}-"""Updates an existing staff user."""+"""+Updates an existing staff user. Requires one of the following permissions: MANAGE_STAFF.+"""type StaffUpdate {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!@@ -15348,14 +16208,18 @@ input StaffUpdateInput {removeGroups: [ID!]}-"""Deletes a staff user."""+"""+Deletes a staff user. Requires one of the following permissions: MANAGE_STAFF.+"""type StaffDelete {staffErrors: [StaffError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [StaffError!]!user: User}-"""Deletes staff users."""+"""+Deletes staff users. Requires one of the following permissions: MANAGE_STAFF.+"""type StaffBulkDelete {"""Returns how many objects were affected."""count: Int!@@ -15381,7 +16245,9 @@ type UserAvatarDelete {errors: [AccountError!]!}-"""Activate or deactivate users."""+"""+Activate or deactivate users. Requires one of the following permissions: MANAGE_USERS.+"""type UserBulkSetActive {"""Returns how many objects were affected."""count: Int!@@ -15389,7 +16255,9 @@ type UserBulkSetActive {errors: [AccountError!]!}-"""Create new permission group."""+"""+Create new permission group. Requires one of the following permissions: MANAGE_STAFF.+"""type PermissionGroupCreate {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!@@ -15438,7 +16306,9 @@ input PermissionGroupCreateInput {name: String!}-"""Update permission group."""+"""+Update permission group. Requires one of the following permissions: MANAGE_STAFF.+"""type PermissionGroupUpdate {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!@@ -15462,7 +16332,9 @@ input PermissionGroupUpdateInput {removeUsers: [ID!]}-"""Delete permission group."""+"""+Delete permission group. Requires one of the following permissions: MANAGE_STAFF.+"""type PermissionGroupDelete {permissionGroupErrors: [PermissionGroupError!]! @deprecated(reason: "This field will be removed in Saleor 4.0. Use `errors` field instead.")errors: [PermissionGroupError!]!diff --git a/saleor/graphql/webhook/mutations.py b/saleor/graphql/webhook/mutations.pyindex cbde52b378..61480561e3 100644--- a/saleor/graphql/webhook/mutations.py+++ b/saleor/graphql/webhook/mutations.py@@ -1,7 +1,7 @@import graphenefrom django.core.exceptions import ValidationError-from ...core.permissions import AppPermission+from ...core.permissions import AppPermission, AuthorizationFiltersfrom ...webhook import modelsfrom ...webhook.error_codes import WebhookErrorCodefrom ..core.descriptions import DEPRECATED_IN_3X_INPUT@@ -63,7 +63,10 @@ class WebhookCreate(ModelMutation):description = "Creates a new webhook subscription."model = models.Webhookobject_type = Webhook- permissions = (AppPermission.MANAGE_APPS,)+ permissions = (+ AppPermission.MANAGE_APPS,+ AuthorizationFilters.AUTHENTICATED_APP,+ )error_type_class = WebhookErrorerror_type_field = "webhook_errors"@@ -99,12 +102,6 @@ class WebhookCreate(ModelMutation):instance.app = appreturn instance- @classmethod- def check_permissions(cls, context):- has_perm = super().check_permissions(context)- has_perm = bool(context.app) or has_perm- return has_perm-@classmethoddef save(cls, info, instance, cleaned_input):instance.save()@@ -211,16 +208,13 @@ class WebhookDelete(ModelDeleteMutation):description = "Deletes a webhook subscription."model = models.Webhookobject_type = Webhook- permissions = (AppPermission.MANAGE_APPS,)+ permissions = (+ AppPermission.MANAGE_APPS,+ AuthorizationFilters.AUTHENTICATED_APP,+ )error_type_class = WebhookErrorerror_type_field = "webhook_errors"- @classmethod- def check_permissions(cls, context):- has_perm = super().check_permissions(context)- has_perm = bool(context.app) or has_perm- return has_perm-@classmethoddef perform_mutation(cls, _root, info, **data):node_id = data["id"]diff --git a/saleor/graphql/webhook/resolvers.py b/saleor/graphql/webhook/resolvers.pyindex 9fb820c01a..d9e22dd745 100644--- a/saleor/graphql/webhook/resolvers.py+++ b/saleor/graphql/webhook/resolvers.py@@ -15,7 +15,7 @@ def resolve_webhooks(info, **_kwargs):else:user = info.context.userif not user.has_perm(AppPermission.MANAGE_APPS):- raise PermissionDenied()+ raise PermissionDenied(permissions=[AppPermission.MANAGE_APPS])qs = models.Webhook.objects.all()return qs