Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Split account mutations for files
fowczarek2bb2036eb8e3
diff --git a/saleor/graphql/account/mutations/__init__.py b/saleor/graphql/account/mutations/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/saleor/graphql/account/mutations/account.py b/saleor/graphql/account/mutations/account.pynew file mode 100644index 0000000000..60da8d0c0a--- /dev/null+++ b/saleor/graphql/account/mutations/account.py@@ -0,0 +1,186 @@+import graphene+from django.core.exceptions import ValidationError++from ....account import emails, events as account_events, models, utils+from ....checkout import AddressType+from ...account.enums import AddressTypeEnum+from ...account.types import Address, AddressInput, User+from ...core.mutations import BaseMutation, ModelMutation+from .staff import CustomerCreate, UserAddressInput+++class CustomerRegisterInput(graphene.InputObjectType):+ email = graphene.String(+ description="The unique email address of the user.", required=True+ )+ password = graphene.String(description="Password", required=True)+++class CustomerRegister(ModelMutation):+ class Arguments:+ input = CustomerRegisterInput(+ description="Fields required to create a user.", required=True+ )++ class Meta:+ description = "Register a new user."+ exclude = ["password"]+ model = models.User++ @classmethod+ def save(cls, info, user, cleaned_input):+ password = cleaned_input["password"]+ user.set_password(password)+ user.save()+ account_events.customer_account_created_event(user=user)+++class LoggedUserUpdate(CustomerCreate):+ class Arguments:+ input = UserAddressInput(+ description="Fields required to update logged in user.", required=True+ )++ class Meta:+ description = (+ "DEPRECATED: Use AccountUpdate instead. "+ "Updates data of the logged in user."+ )+ exclude = ["password"]+ model = models.User++ @classmethod+ def check_permissions(cls, user):+ return user.is_authenticated++ @classmethod+ def perform_mutation(cls, root, info, **data):+ user = info.context.user+ data["id"] = graphene.Node.to_global_id("User", user.id)+ return super().perform_mutation(root, info, **data)+++class AccountInput(graphene.InputObjectType):+ first_name = graphene.String(description="Given name.")+ last_name = graphene.String(description="Family name.")+ default_billing_address = AddressInput(+ description="Billing address of the customer."+ )+ default_shipping_address = AddressInput(+ description="Shipping address of the customer."+ )+++class AccountUpdate(CustomerCreate):+ class Arguments:+ input = AccountInput(+ description="Fields required to update the account of the logged-in user.",+ required=True,+ )++ class Meta:+ description = "Updates the account of the logged-in user."+ exclude = ["password"]+ model = models.User++ @classmethod+ def check_permissions(cls, user):+ return user.is_authenticated++ @classmethod+ def perform_mutation(cls, root, info, **data):+ user = info.context.user+ data["id"] = graphene.Node.to_global_id("User", user.id)+ return super().perform_mutation(root, info, **data)+++class AccountRequestDeletion(BaseMutation):+ class Meta:+ description = (+ "Sends an email with the account removal link for the logged-in user."+ )++ @classmethod+ def check_permissions(cls, user):+ return user.is_authenticated++ @classmethod+ def perform_mutation(cls, root, info, **data):+ user = info.context.user+ emails.send_account_delete_confirmation_email.delay(str(user.token), user.email)+ return AccountRequestDeletion()+++# The same as AddressCreate, but for the currently authenticated user.+class CustomerAddressCreate(ModelMutation):+ class Arguments:+ input = AddressInput(+ description="Fields required to create address", required=True+ )+ type = AddressTypeEnum(+ required=False,+ description=(+ "A type of address. If provided, the new address will be "+ "automatically assigned as the customer's default address "+ "of that type."+ ),+ )++ class Meta:+ description = "Create a new address for the customer."+ model = models.Address+ exclude = ["user_addresses"]++ @classmethod+ def check_permissions(cls, user):+ return user.is_authenticated++ @classmethod+ def perform_mutation(cls, root, info, **data):+ success_response = super().perform_mutation(root, info, **data)+ address_type = data.get("type", None)+ if address_type:+ user = info.context.user+ instance = success_response.address+ utils.change_user_default_address(user, instance, address_type)+ return success_response++ @classmethod+ def save(cls, info, instance, cleaned_input):+ super().save(info, instance, cleaned_input)+ user = info.context.user+ instance.user_addresses.add(user)+++# The same as SetDefaultAddress, but for the currently authenticated user.+class CustomerSetDefaultAddress(BaseMutation):+ user = graphene.Field(User, description="An updated user instance.")++ class Arguments:+ id = graphene.ID(+ required=True, description="ID of the address to set as default."+ )+ type = AddressTypeEnum(required=True, description="The type of address.")++ class Meta:+ description = "Sets a default address for the authenticated user."++ @classmethod+ def check_permissions(cls, user):+ return user.is_authenticated++ @classmethod+ def perform_mutation(cls, _root, info, **data):+ address = cls.get_node_or_error(info, data.get("id"), Address)++ user = info.context.user+ if address not in user.addresses.all():+ raise ValidationError({"id": "The address doesn't belong to that user."})++ if data.get("type") == AddressTypeEnum.BILLING.value:+ address_type = AddressType.BILLING+ else:+ address_type = AddressType.SHIPPING++ utils.change_user_default_address(user, address, address_type)+ return cls(user=user)diff --git a/saleor/graphql/account/mutations/base.py b/saleor/graphql/account/mutations/base.pynew file mode 100644index 0000000000..ff8a536fca--- /dev/null+++ b/saleor/graphql/account/mutations/base.py@@ -0,0 +1,204 @@+import graphene+from django.conf import settings+from django.contrib.auth.tokens import default_token_generator+from django.core.exceptions import ObjectDoesNotExist, ValidationError+from django.utils.encoding import force_bytes+from django.utils.http import urlsafe_base64_encode+from graphql_jwt.exceptions import PermissionDenied++from ....account import emails, events as account_events, models+from ...account.types import Address, AddressInput, User+from ...core.mutations import (+ BaseMutation,+ ClearMetaBaseMutation,+ ModelDeleteMutation,+ ModelMutation,+ UpdateMetaBaseMutation,+)+++def send_user_password_reset_email(user, site):+ context = {+ "email": user.email,+ "uid": urlsafe_base64_encode(force_bytes(user.pk)),+ "token": default_token_generator.make_token(user),+ "site_name": site.name,+ "domain": site.domain,+ "protocol": "https" if settings.ENABLE_SSL else "http",+ }+ emails.send_password_reset_email.delay(context, user.email, user.pk)+++def can_edit_address(user, address):+ """Determine whether the user can edit the given address.++ This method assumes that an address can be edited by:+ - users with proper permission (staff)+ - customers who "own" the given address.+ """+ has_perm = user.has_perm("account.manage_users")+ belongs_to_user = address in user.addresses.all()+ return has_perm or belongs_to_user+++class SetPasswordInput(graphene.InputObjectType):+ token = graphene.String(+ description="A one-time token required to set the password.", required=True+ )+ password = graphene.String(description="Password", required=True)+++class SetPassword(ModelMutation):+ INVALID_TOKEN = "Invalid or expired token."++ class Arguments:+ id = graphene.ID(+ description="ID of a user to set password whom.", required=True+ )+ input = SetPasswordInput(+ description="Fields required to set password.", required=True+ )++ class Meta:+ description = "Sets user password."+ model = models.User++ @classmethod+ def clean_input(cls, info, instance, data):+ cleaned_input = super().clean_input(info, instance, data)+ token = cleaned_input.pop("token")+ if not default_token_generator.check_token(instance, token):+ raise ValidationError({"token": SetPassword.INVALID_TOKEN})+ return cleaned_input++ @classmethod+ def save(cls, info, instance, cleaned_input):+ instance.set_password(cleaned_input["password"])+ instance.save()+ account_events.customer_password_reset_event(user=instance)+++class CustomerPasswordResetInput(graphene.InputObjectType):+ email = graphene.String(+ required=True,+ description=("Email of the user that will be used for password recovery."),+ )+++class CustomerPasswordReset(BaseMutation):+ class Arguments:+ input = CustomerPasswordResetInput(+ description="Fields required to reset customer's password", required=True+ )++ class Meta:+ description = "Resets the customer's password."++ @classmethod+ def perform_mutation(cls, _root, info, **data):+ email = data.get("input")["email"]+ try:+ user = models.User.objects.get(email=email)+ except ObjectDoesNotExist:+ raise ValidationError({"email": "User with this email doesn't exist"})+ site = info.context.site+ send_user_password_reset_email(user, site)+ return CustomerPasswordReset()+++class AddressUpdate(ModelMutation):+ user = graphene.Field(+ User, description="A user instance for which the address was edited."+ )++ class Arguments:+ id = graphene.ID(description="ID of the address to update", required=True)+ input = AddressInput(+ description="Fields required to update address", required=True+ )++ class Meta:+ description = "Updates an address"+ model = models.Address+ exclude = ["user_addresses"]++ @classmethod+ 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.user, instance):+ raise PermissionDenied()+ return super().clean_input(info, instance, data)++ @classmethod+ def perform_mutation(cls, root, info, **data):+ response = super().perform_mutation(root, info, **data)+ user = response.address.user_addresses.first()+ response.user = user+ return response+++class AddressDelete(ModelDeleteMutation):+ user = graphene.Field(+ User, description="A user instance for which the address was deleted."+ )++ class Arguments:+ id = graphene.ID(required=True, description="ID of the address to delete.")++ class Meta:+ description = "Deletes an address"+ model = models.Address++ @classmethod+ 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.user, instance):+ raise PermissionDenied()+ return super().clean_instance(info, instance)++ @classmethod+ def perform_mutation(cls, _root, info, **data):+ if not cls.check_permissions(info.context.user):+ raise PermissionDenied()++ node_id = data.get("id")+ instance = cls.get_node_or_error(info, node_id, Address)+ if instance:+ cls.clean_instance(info, instance)++ db_id = instance.id++ # Return the first user that the address is assigned to. There is M2M+ # relation between users and addresses, but in most cases address is+ # related to only one user.+ user = instance.user_addresses.first()++ instance.delete()+ instance.id = db_id++ response = cls.success_response(instance)++ # Refresh the user instance to clear the default addresses. If the+ # deleted address was used as default, it would stay cached in the+ # user instance and the invalid ID returned in the response might cause+ # an error.+ user.refresh_from_db()++ response.user = user+ return response+++class UserUpdateMeta(UpdateMetaBaseMutation):+ class Meta:+ description = "Updates metadata for user."+ model = models.User+ public = True+++class UserClearStoredMeta(ClearMetaBaseMutation):+ class Meta:+ description = "Clear stored metadata value."+ model = models.User+ public = Truediff --git a/saleor/graphql/account/mutations.py b/saleor/graphql/account/mutations/staff.pysimilarity index 54%rename from saleor/graphql/account/mutations.pyrename to saleor/graphql/account/mutations/staff.pyindex 2376aade6f..aee56354a3 100644--- a/saleor/graphql/account/mutations.py+++ b/saleor/graphql/account/mutations/staff.py@@ -1,93 +1,39 @@from copy import copyimport graphene-from django.conf import settings-from django.contrib.auth.tokens import default_token_generatorfrom django.core.exceptions import ObjectDoesNotExist, ValidationError-from django.utils.encoding import force_bytes-from django.utils.http import urlsafe_base64_encodefrom graphql_jwt.decorators import staff_member_requiredfrom graphql_jwt.exceptions import PermissionDenied-from ...account import emails, events as account_events, models, utils-from ...account.thumbnails import create_user_avatar_thumbnails-from ...account.utils import get_random_avatar-from ...checkout import AddressType-from ...core.permissions import get_permissions-from ...dashboard.emails import (+from ....account import events as account_events, models, utils+from ....account.thumbnails import create_user_avatar_thumbnails+from ....account.utils import get_random_avatar+from ....checkout import AddressType+from ....core.permissions import get_permissions+from ....dashboard.emails import (send_set_password_customer_email,send_set_password_staff_email,)-from ...dashboard.staff.utils import remove_staff_member-from ..account.enums import AddressTypeEnum-from ..account.i18n import I18nMixin-from ..account.types import Address, AddressInput, User-from ..core.enums import PermissionEnum-from ..core.mutations import (+from ....dashboard.staff.utils import remove_staff_member+from ...account.enums import AddressTypeEnum+from ...account.i18n import I18nMixin+from ...account.types import Address, AddressInput, User+from ...core.enums import PermissionEnum+from ...core.mutations import (BaseMutation,ClearMetaBaseMutation,ModelDeleteMutation,ModelMutation,UpdateMetaBaseMutation,)-from ..core.types import Upload-from ..core.utils import validate_image_file-from .utils import CustomerDeleteMixin, StaffDeleteMixin, UserDeleteMixin+from ...core.types import Upload+from ...core.utils import validate_image_file+from ..utils import CustomerDeleteMixin, StaffDeleteMixin, UserDeleteMixinBILLING_ADDRESS_FIELD = "default_billing_address"SHIPPING_ADDRESS_FIELD = "default_shipping_address"-def send_user_password_reset_email(user, site):- context = {- "email": user.email,- "uid": urlsafe_base64_encode(force_bytes(user.pk)),- "token": default_token_generator.make_token(user),- "site_name": site.name,- "domain": site.domain,- "protocol": "https" if settings.ENABLE_SSL else "http",- }- emails.send_password_reset_email.delay(context, user.email, user.pk)---def can_edit_address(user, address):- """Determine whether the user can edit the given address.-- This method assumes that an address can be edited by:- - users with proper permission (staff)- - customers who "own" the given address.- """- has_perm = user.has_perm("account.manage_users")- belongs_to_user = address in user.addresses.all()- return has_perm or belongs_to_user---class CustomerRegisterInput(graphene.InputObjectType):- email = graphene.String(- description="The unique email address of the user.", required=True- )- password = graphene.String(description="Password", required=True)---class CustomerRegister(ModelMutation):- class Arguments:- input = CustomerRegisterInput(- description="Fields required to create a user.", required=True- )-- class Meta:- description = "Register a new user."- exclude = ["password"]- model = models.User-- @classmethod- def save(cls, info, user, cleaned_input):- password = cleaned_input["password"]- user.set_password(password)- user.save()- account_events.customer_account_created_event(user=user)--class UserInput(graphene.InputObjectType):first_name = graphene.String(description="Given name.")last_name = graphene.String(description="Family name.")@@ -122,17 +68,6 @@ class StaffInput(UserInput):)-class AccountInput(graphene.InputObjectType):- first_name = graphene.String(description="Given name.")- last_name = graphene.String(description="Family name.")- default_billing_address = AddressInput(- description="Billing address of the customer."- )- default_shipping_address = AddressInput(- description="Shipping address of the customer."- )--class StaffCreateInput(StaffInput):send_password_email = graphene.Boolean(description="Send an email with a link to set a password"@@ -257,71 +192,6 @@ class CustomerUpdate(CustomerCreate):return cls.success_response(new_instance)-class LoggedUserUpdate(CustomerCreate):- class Arguments:- input = UserAddressInput(- description="Fields required to update logged in user.", required=True- )-- class Meta:- description = (- "DEPRECATED: Use AccountUpdate instead. "- "Updates data of the logged in user."- )- exclude = ["password"]- model = models.User-- @classmethod- def check_permissions(cls, user):- return user.is_authenticated-- @classmethod- def perform_mutation(cls, root, info, **data):- user = info.context.user- data["id"] = graphene.Node.to_global_id("User", user.id)- return super().perform_mutation(root, info, **data)---class AccountUpdate(CustomerCreate):- class Arguments:- input = AccountInput(- description="Fields required to update the account of the logged-in user.",- required=True,- )-- class Meta:- description = "Updates the account of the logged-in user."- exclude = ["password"]- model = models.User-- @classmethod- def check_permissions(cls, user):- return user.is_authenticated-- @classmethod- def perform_mutation(cls, root, info, **data):- user = info.context.user- data["id"] = graphene.Node.to_global_id("User", user.id)- return super().perform_mutation(root, info, **data)---class AccountRequestDeletion(BaseMutation):- class Meta:- description = (- "Sends an email with the account removal link for the logged-in user."- )-- @classmethod- def check_permissions(cls, user):- return user.is_authenticated-- @classmethod- def perform_mutation(cls, root, info, **data):- user = info.context.user- emails.send_account_delete_confirmation_email.delay(str(user.token), user.email)- return AccountRequestDeletion()--class UserDelete(UserDeleteMixin, ModelDeleteMutation):class Meta:abstract = True@@ -440,43 +310,6 @@ class StaffDelete(StaffDeleteMixin, UserDelete):return cls.success_response(instance)-class SetPasswordInput(graphene.InputObjectType):- token = graphene.String(- description="A one-time token required to set the password.", required=True- )- password = graphene.String(description="Password", required=True)---class SetPassword(ModelMutation):- INVALID_TOKEN = "Invalid or expired token."-- class Arguments:- id = graphene.ID(- description="ID of a user to set password whom.", required=True- )- input = SetPasswordInput(- description="Fields required to set password.", required=True- )-- class Meta:- description = "Sets user password."- model = models.User-- @classmethod- def clean_input(cls, info, instance, data):- cleaned_input = super().clean_input(info, instance, data)- token = cleaned_input.pop("token")- if not default_token_generator.check_token(instance, token):- raise ValidationError({"token": SetPassword.INVALID_TOKEN})- return cleaned_input-- @classmethod- def save(cls, info, instance, cleaned_input):- instance.set_password(cleaned_input["password"])- instance.save()- account_events.customer_password_reset_event(user=instance)--class PasswordReset(BaseMutation):class Arguments:email = graphene.String(description="Email", required=True)@@ -496,34 +329,6 @@ class PasswordReset(BaseMutation):return PasswordReset()-class CustomerPasswordResetInput(graphene.InputObjectType):- email = graphene.String(- required=True,- description=("Email of the user that will be used for password recovery."),- )---class CustomerPasswordReset(BaseMutation):- class Arguments:- input = CustomerPasswordResetInput(- description="Fields required to reset customer's password", required=True- )-- class Meta:- description = "Resets the customer's password."-- @classmethod- def perform_mutation(cls, _root, info, **data):- email = data.get("input")["email"]- try:- user = models.User.objects.get(email=email)- except ObjectDoesNotExist:- raise ValidationError({"email": "User with this email doesn't exist"})- site = info.context.site- send_user_password_reset_email(user, site)- return CustomerPasswordReset()--class AddressCreate(ModelMutation):user = graphene.Field(User, description="A user instance for which the address was created."@@ -553,90 +358,6 @@ class AddressCreate(ModelMutation):return response-class AddressUpdate(ModelMutation):- user = graphene.Field(- User, description="A user instance for which the address was edited."- )-- class Arguments:- id = graphene.ID(description="ID of the address to update", required=True)- input = AddressInput(- description="Fields required to update address", required=True- )-- class Meta:- description = "Updates an address"- model = models.Address- exclude = ["user_addresses"]-- @classmethod- 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.user, instance):- raise PermissionDenied()- return super().clean_input(info, instance, data)-- @classmethod- def perform_mutation(cls, root, info, **data):- response = super().perform_mutation(root, info, **data)- user = response.address.user_addresses.first()- response.user = user- return response---class AddressDelete(ModelDeleteMutation):- user = graphene.Field(- User, description="A user instance for which the address was deleted."- )-- class Arguments:- id = graphene.ID(required=True, description="ID of the address to delete.")-- class Meta:- description = "Deletes an address"- model = models.Address-- @classmethod- 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.user, instance):- raise PermissionDenied()- return super().clean_instance(info, instance)-- @classmethod- def perform_mutation(cls, _root, info, **data):- if not cls.check_permissions(info.context.user):- raise PermissionDenied()-- node_id = data.get("id")- instance = cls.get_node_or_error(info, node_id, Address)- if instance:- cls.clean_instance(info, instance)-- db_id = instance.id-- # Return the first user that the address is assigned to. There is M2M- # relation between users and addresses, but in most cases address is- # related to only one user.- user = instance.user_addresses.first()-- instance.delete()- instance.id = db_id-- response = cls.success_response(instance)-- # Refresh the user instance to clear the default addresses. If the- # deleted address was used as default, it would stay cached in the- # user instance and the invalid ID returned in the response might cause- # an error.- user.refresh_from_db()-- response.user = user- return response--class AddressSetDefault(BaseMutation):user = graphene.Field(User, description="An updated user instance.")@@ -672,81 +393,6 @@ class AddressSetDefault(BaseMutation):return cls(user=user)-# The same as AddressCreate, but for the currently authenticated user.-class CustomerAddressCreate(ModelMutation):- class Arguments:- input = AddressInput(- description="Fields required to create address", required=True- )- type = AddressTypeEnum(- required=False,- description=(- "A type of address. If provided, the new address will be "- "automatically assigned as the customer's default address "- "of that type."- ),- )-- class Meta:- description = "Create a new address for the customer."- model = models.Address- exclude = ["user_addresses"]-- @classmethod- def check_permissions(cls, user):- return user.is_authenticated-- @classmethod- def perform_mutation(cls, root, info, **data):- success_response = super().perform_mutation(root, info, **data)- address_type = data.get("type", None)- if address_type:- user = info.context.user- instance = success_response.address- utils.change_user_default_address(user, instance, address_type)- return success_response-- @classmethod- def save(cls, info, instance, cleaned_input):- super().save(info, instance, cleaned_input)- user = info.context.user- instance.user_addresses.add(user)---# The same as SetDefaultAddress, but for the currently authenticated user.-class CustomerSetDefaultAddress(BaseMutation):- user = graphene.Field(User, description="An updated user instance.")-- class Arguments:- id = graphene.ID(- required=True, description="ID of the address to set as default."- )- type = AddressTypeEnum(required=True, description="The type of address.")-- class Meta:- description = "Sets a default address for the authenticated user."-- @classmethod- def check_permissions(cls, user):- return user.is_authenticated-- @classmethod- def perform_mutation(cls, _root, info, **data):- address = cls.get_node_or_error(info, data.get("id"), Address)-- user = info.context.user- if address not in user.addresses.all():- raise ValidationError({"id": "The address doesn't belong to that user."})-- if data.get("type") == AddressTypeEnum.BILLING.value:- address_type = AddressType.BILLING- else:- address_type = AddressType.SHIPPING-- utils.change_user_default_address(user, address, address_type)- return cls(user=user)--class UserAvatarUpdate(BaseMutation):user = graphene.Field(User, description="An updated user instance.")@@ -796,13 +442,6 @@ class UserAvatarDelete(BaseMutation):return UserAvatarDelete(user=user)-class UserUpdateMeta(UpdateMetaBaseMutation):- class Meta:- description = "Updates metadata for user."- model = models.User- public = True--class UserUpdatePrivateMeta(UpdateMetaBaseMutation):class Meta:description = "Updates private metadata for user."@@ -811,13 +450,6 @@ class UserUpdatePrivateMeta(UpdateMetaBaseMutation):public = False-class UserClearStoredMeta(ClearMetaBaseMutation):- class Meta:- description = "Clear stored metadata value."- model = models.User- public = True--class UserClearStoredPrivateMeta(ClearMetaBaseMutation):class Meta:description = "Clear stored metadata value."diff --git a/saleor/graphql/account/schema.py b/saleor/graphql/account/schema.pyindex efa0cf1d3e..8478d5bb7f 100644--- a/saleor/graphql/account/schema.py+++ b/saleor/graphql/account/schema.py@@ -7,31 +7,35 @@ from ..descriptions import DESCRIPTIONSfrom .bulk_mutations import CustomerBulkDelete, StaffBulkDelete, UserBulkSetActivefrom .enums import CountryCodeEnumfrom .filters import CustomerFilter, StaffUserFilter-from .mutations import (+from .mutations.account import (AccountRequestDeletion,AccountUpdate,- AddressCreate,+ CustomerAddressCreate,+ CustomerRegister,+ CustomerSetDefaultAddress,+ LoggedUserUpdate,+)+from .mutations.base import (AddressDelete,- AddressSetDefault,AddressUpdate,- CustomerAddressCreate,+ CustomerPasswordReset,+ SetPassword,+ UserClearStoredMeta,+ UserUpdateMeta,+)+from .mutations.staff import (+ AddressCreate,+ AddressSetDefault,CustomerCreate,CustomerDelete,- CustomerPasswordReset,- CustomerRegister,- CustomerSetDefaultAddress,CustomerUpdate,- LoggedUserUpdate,PasswordReset,- SetPassword,StaffCreate,StaffDelete,StaffUpdate,UserAvatarDelete,UserAvatarUpdate,- UserClearStoredMeta,UserClearStoredPrivateMeta,- UserUpdateMeta,UserUpdatePrivateMeta,)from .resolvers import resolve_address_validator, resolve_customers, resolve_staff_users