Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Split core types into multiple files
Marcin Gębala301f2b44fc3e
diff --git a/saleor/graphql/account/types.py b/saleor/graphql/account/types.pyindex 0f7d0fdd70..047c9bab06 100644--- a/saleor/graphql/account/types.py+++ b/saleor/graphql/account/types.py@@ -3,7 +3,7 @@ from django.contrib.auth import get_user_model, models as auth_modelsfrom graphene import relayfrom ...account import models-from ..core.types import CountableDjangoObjectType, PermissionDisplay+from ..core.types.common import CountableDjangoObjectType, PermissionDisplayfrom ..utils import format_permissions_for_displaydiff --git a/saleor/graphql/api.py b/saleor/graphql/api.pyindex 26a889adea..6351b0e881 100644--- a/saleor/graphql/api.py+++ b/saleor/graphql/api.py@@ -22,8 +22,7 @@ from .discount.mutations import (VoucherUpdate)from .core.filters import DistinctFilterSetfrom .core.mutations import CreateToken, VerifyToken-from .core.resolvers import resolve_shop-from .core.types import Shop+from .core.types.shop import Shopfrom .order.filters import OrderFilterfrom .order.resolvers import resolve_order, resolve_ordersfrom .order.types import Order@@ -134,9 +133,7 @@ class Query(graphene.ObjectType):sales = DjangoFilterConnectionField(Sale, query=graphene.String(description=DESCRIPTIONS['sale']),description="List of the shop\'s sales.")- shop = graphene.Field(- Shop, description='Represents a shop resources.',- resolver=resolve_shop)+ shop = graphene.Field(Shop, description='Represents a shop resources.')voucher = graphene.Field(Voucher, id=graphene.Argument(graphene.ID),description='Lookup a voucher by ID.')@@ -214,6 +211,9 @@ class Query(graphene.ObjectType):def resolve_product_types(self, info, **kwargs):return resolve_product_types()+ def resolve_shop(self, info):+ return Shop()+@permission_required('discount.manage_discounts')def resolve_sale(self, info, id):return get_node(info, id, only_type=Sale)diff --git a/saleor/graphql/core/fields.py b/saleor/graphql/core/fields.pyindex 89876a854f..2471efca44 100644--- a/saleor/graphql/core/fields.py+++ b/saleor/graphql/core/fields.py@@ -2,7 +2,7 @@ import graphenefrom django_prices.models import MoneyField, TaxedMoneyFieldfrom graphene_django.converter import convert_django_field-from .types import Money, TaxedMoney+from .types.money import Money, TaxedMoney@convert_django_field.register(TaxedMoneyField)diff --git a/saleor/graphql/core/mutations.py b/saleor/graphql/core/mutations.pyindex e3cbc6f54f..729dc38f2c 100644--- a/saleor/graphql/core/mutations.py+++ b/saleor/graphql/core/mutations.py@@ -11,7 +11,7 @@ from ...account import modelsfrom ..account.types import Userfrom ..file_upload.types import Uploadfrom ..utils import get_node, get_nodes-from .types import Error+from .types.common import Errorregistry = get_global_registry()diff --git a/saleor/graphql/core/resolvers.py b/saleor/graphql/core/resolvers.pydeleted file mode 100644index 3d308c8ef6..0000000000--- a/saleor/graphql/core/resolvers.py+++ /dev/null@@ -1,48 +0,0 @@-from django.conf import settings-from django_countries import countries-from phonenumbers import COUNTRY_CODE_TO_REGION_CODE--from ...core.permissions import get_permissions-from ..utils import format_permissions_for_display-from .types import CountryDisplay, LanguageDisplay, Shop, Domain---def resolve_shop(root, info, *args, **kwargs):- site = info.context.site- return Shop(- countries=resolve_countries(info),- currencies=settings.AVAILABLE_CURRENCIES,- domain=resolve_domain(info, site),- default_currency=settings.DEFAULT_CURRENCY,- languages=resolve_languages(info),- name=site.name,- permissions=resolve_permissions(info),- phone_prefixes=resolve_phone_prefixes(info))---def resolve_domain(info, site):- return Domain(- host=site.domain,- ssl_enabled=settings.ENABLE_SSL,- url=info.context.build_absolute_uri('/'))---def resolve_phone_prefixes(info):- return list(COUNTRY_CODE_TO_REGION_CODE.keys())---def resolve_countries(info):- return [- CountryDisplay(code=country[0], country=country[1])- for country in countries]---def resolve_languages(info):- return [- LanguageDisplay(code=language[0], language=language[1])- for language in settings.LANGUAGES]---def resolve_permissions(info):- permissions = get_permissions()- return format_permissions_for_display(permissions)diff --git a/saleor/graphql/core/types.py b/saleor/graphql/core/types.pydeleted file mode 100644index 2b7ee49312..0000000000--- a/saleor/graphql/core/types.py+++ /dev/null@@ -1,212 +0,0 @@-import decimal--import graphene-from django_prices.templatetags import prices_i18n-from django_prices_vatlayer import models as vatlayer_models-from graphene.types import Scalar-from graphene_django import DjangoObjectType-from graphql.language import ast--from .connection import CountableConnection---# FIXME: not yet merged https://github.com/graphql-python/graphene/pull/726-class Decimal(Scalar):- """The `Decimal` scalar type represents a python Decimal."""-- @staticmethod- def serialize(dec):- assert isinstance(dec, decimal.Decimal), (- 'Received not compatible Decimal "{}"'.format(repr(dec)))- return str(dec)-- @staticmethod- def parse_value(value):- return decimal.Decimal(value)-- @classmethod- def parse_literal(cls, node):- if isinstance(node, ast.StringValue):- return cls.parse_value(node.value)---class CountryDisplay(graphene.ObjectType):- code = graphene.String(description='Country code.', required=True)- country = graphene.String(description='Country.', required=True)---class CountableDjangoObjectType(DjangoObjectType):- class Meta:- abstract = True-- @classmethod- def __init_subclass_with_meta__(cls, *args, **kwargs):- # Force it to use the countable connection- countable_conn = CountableConnection.create_type(- "{}CountableConnection".format(cls.__name__),- node=cls)- super().__init_subclass_with_meta__(- *args, connection=countable_conn, **kwargs)---class Error(graphene.ObjectType):- field = graphene.String(- description="""Name of a field that caused the error. A value of- `null` indicates that the error isn't associated with a particular- field.""", required=False)- message = graphene.String(description='The error message.')-- class Meta:- description = 'Represents an error in the input of a mutation.'---class LanguageDisplay(graphene.ObjectType):- code = graphene.String(description='Language code.', required=True)- language = graphene.String(description='Language.', required=True)---class Money(graphene.ObjectType):- currency = graphene.String(description='Currency code.', required=True)- amount = graphene.Float(description='Amount of money.', required=True)- localized = graphene.String(- description='Money formatted according to the current locale.',- required=True)-- class Meta:- description = 'Represents amount of money in specific currency.'-- def resolve_localized(self, info):- return prices_i18n.amount(self)---class MoneyRange(graphene.ObjectType):- start = graphene.Field(- Money, description='Lower bound of a price range.')- stop = graphene.Field(- Money, description='Upper bound of a price range.')-- class Meta:- description = 'Represents a range of amounts of money.'---class PermissionDisplay(graphene.ObjectType):- code = graphene.String(- description='Internal code for permission.', required=True)- name = graphene.String(- description='Describe action(s) allowed to do by permission.',- required=True)-- class Meta:- description = 'Represents a permission object in a friendly form.'---class SeoInput(graphene.InputObjectType):- title = graphene.String(description='SEO title.')- description = graphene.String(description='SEO description.')---class TaxedMoney(graphene.ObjectType):- currency = graphene.String(description='Currency code.', required=True)- gross = graphene.Field(- Money, description='Amount of money including taxes.', required=True)- net = graphene.Field(- Money, description='Amount of money without taxes.', required=True)- tax = graphene.Field(Money, description='Amount of taxes.', required=True)-- class Meta:- description = """Represents a monetary value with taxes. In- case when taxes were not applied, net and gross values will be equal.- """---class TaxedMoneyRange(graphene.ObjectType):- start = graphene.Field(- TaxedMoney, description='Lower bound of a price range.')- stop = graphene.Field(- TaxedMoney, description='Upper bound of a price range.')-- class Meta:- description = 'Represents a range of monetary values.'---class Shop(graphene.ObjectType):- countries = graphene.List(- CountryDisplay, description='List of countries available in the shop.',- required=True)- currencies = graphene.List(- graphene.String, description='List of available currencies.',- required=True)- default_currency = graphene.String(- description='Default shop\'s currency.', required=True)- domain = graphene.Field(- lambda: Domain, required=True, description='Shop\'s domain data.')- languages = graphene.List(- LanguageDisplay,- description='List of the shops\'s supported languages.', required=True)- name = graphene.String(description='Shop\'s name.', required=True)- permissions = graphene.List(- PermissionDisplay, description='List of available permissions.',- required=True)- phone_prefixes = graphene.List(- graphene.String, description='List of possible phone prefixes.',- required=True)- tax_rates = graphene.List(- lambda: VAT, description='List of VAT tax rates configured in the shop.',- required=True)- tax_rate = graphene.Field(- lambda: VAT, description='VAT tax rates for a specific country.',- required=False, country_code=graphene.Argument(graphene.String))-- class Meta:- description = '''- Represents a shop resource containing general shop\'s data- and configuration.'''-- def resolve_tax_rates(self, info):- return vatlayer_models.VAT.objects.order_by('country_code')-- def resolve_tax_rate(self, info, country_code):- return vatlayer_models.VAT.objects.filter(- country_code=country_code).first()---class Domain(graphene.ObjectType):- host = graphene.String(- description='The host name of the domain.', required=True)- ssl_enabled = graphene.Boolean(- description='Inform if SSL is enabled.', required=True)- url = graphene.String(- description='Shop\'s absolute URL.', required=True)-- class Meta:- description = 'Represents shop\'s domain.'---class VAT(graphene.ObjectType):- country_code = graphene.String(description='Country code.', required=True)- standard_rate = graphene.Float(- description='Standard VAT rate in percent.')- reduced_rates = graphene.List(- lambda: ReducedRate,- description='Country\'s VAT rate exceptions for specific types of goods.')-- class Meta:- description = 'Represents a VAT rate for a country.'-- def resolve_standard_rate(self, info):- return self.data.get('standard_rate')-- def resolve_reduced_rates(self, info):- reduced_rates = self.data.get('reduced_rates', {}) or {}- return [- ReducedRate(rate=rate, type=type)- for type, rate in reduced_rates.items()]---class ReducedRate(graphene.ObjectType):- rate = graphene.Float(- description='Reduced VAT rate in percent.', required=True)- type = graphene.String(description='A type of goods.', required=True)-- class Meta:- description = 'Represents a reduced VAT rate for a particular type of goods.'diff --git a/saleor/graphql/core/types/__init__.py b/saleor/graphql/core/types/__init__.pynew file mode 100644index 0000000000..e69de29bb2diff --git a/saleor/graphql/core/types/common.py b/saleor/graphql/core/types/common.pynew file mode 100644index 0000000000..4cf8fe368d--- /dev/null+++ b/saleor/graphql/core/types/common.py@@ -0,0 +1,79 @@+import decimal++import graphene+from graphene.types import Scalar+from graphene_django import DjangoObjectType+from graphql.language import ast++from ..connection import CountableConnection+++# FIXME: not yet merged https://github.com/graphql-python/graphene/pull/726+class Decimal(Scalar):+ """The `Decimal` scalar type represents a python Decimal."""++ @staticmethod+ def serialize(dec):+ assert isinstance(dec, decimal.Decimal), (+ 'Received not compatible Decimal "{}"'.format(repr(dec)))+ return str(dec)++ @staticmethod+ def parse_value(value):+ return decimal.Decimal(value)++ @classmethod+ def parse_literal(cls, node):+ if isinstance(node, ast.StringValue):+ return cls.parse_value(node.value)+++class CountryDisplay(graphene.ObjectType):+ code = graphene.String(description='Country code.', required=True)+ country = graphene.String(description='Country.', required=True)+++class CountableDjangoObjectType(DjangoObjectType):+ class Meta:+ abstract = True++ @classmethod+ def __init_subclass_with_meta__(cls, *args, **kwargs):+ # Force it to use the countable connection+ countable_conn = CountableConnection.create_type(+ "{}CountableConnection".format(cls.__name__),+ node=cls)+ super().__init_subclass_with_meta__(+ *args, connection=countable_conn, **kwargs)+++class Error(graphene.ObjectType):+ field = graphene.String(+ description="""Name of a field that caused the error. A value of+ `null` indicates that the error isn't associated with a particular+ field.""", required=False)+ message = graphene.String(description='The error message.')++ class Meta:+ description = 'Represents an error in the input of a mutation.'+++class LanguageDisplay(graphene.ObjectType):+ code = graphene.String(description='Language code.', required=True)+ language = graphene.String(description='Language.', required=True)+++class PermissionDisplay(graphene.ObjectType):+ code = graphene.String(+ description='Internal code for permission.', required=True)+ name = graphene.String(+ description='Describe action(s) allowed to do by permission.',+ required=True)++ class Meta:+ description = 'Represents a permission object in a friendly form.'+++class SeoInput(graphene.InputObjectType):+ title = graphene.String(description='SEO title.')+ description = graphene.String(description='SEO description.')diff --git a/saleor/graphql/core/types/money.py b/saleor/graphql/core/types/money.pynew file mode 100644index 0000000000..1ce4b8b8bb--- /dev/null+++ b/saleor/graphql/core/types/money.py@@ -0,0 +1,81 @@+import graphene++from django_prices.templatetags import prices_i18n+++class Money(graphene.ObjectType):+ currency = graphene.String(description='Currency code.', required=True)+ amount = graphene.Float(description='Amount of money.', required=True)+ localized = graphene.String(+ description='Money formatted according to the current locale.',+ required=True)++ class Meta:+ description = 'Represents amount of money in specific currency.'++ def resolve_localized(self, info):+ return prices_i18n.amount(self)+++class MoneyRange(graphene.ObjectType):+ start = graphene.Field(+ Money, description='Lower bound of a price range.')+ stop = graphene.Field(+ Money, description='Upper bound of a price range.')++ class Meta:+ description = 'Represents a range of amounts of money.'+++class TaxedMoney(graphene.ObjectType):+ currency = graphene.String(description='Currency code.', required=True)+ gross = graphene.Field(+ Money, description='Amount of money including taxes.', required=True)+ net = graphene.Field(+ Money, description='Amount of money without taxes.', required=True)+ tax = graphene.Field(Money, description='Amount of taxes.', required=True)++ class Meta:+ description = """Represents a monetary value with taxes. In+ case when taxes were not applied, net and gross values will be equal.+ """+++class TaxedMoneyRange(graphene.ObjectType):+ start = graphene.Field(+ TaxedMoney, description='Lower bound of a price range.')+ stop = graphene.Field(+ TaxedMoney, description='Upper bound of a price range.')++ class Meta:+ description = 'Represents a range of monetary values.'+++class VAT(graphene.ObjectType):+ country_code = graphene.String(description='Country code.', required=True)+ standard_rate = graphene.Float(+ description='Standard VAT rate in percent.')+ reduced_rates = graphene.List(+ lambda: ReducedRate,+ description='Country\'s VAT rate exceptions for specific types of goods.')++ class Meta:+ description = 'Represents a VAT rate for a country.'++ def resolve_standard_rate(self, info):+ return self.data.get('standard_rate')++ def resolve_reduced_rates(self, info):+ reduced_rates = self.data.get('reduced_rates', {}) or {}+ return [+ ReducedRate(rate=rate, type=type)+ for type, rate in reduced_rates.items()]+++class ReducedRate(graphene.ObjectType):+ rate = graphene.Float(+ description='Reduced VAT rate in percent.', required=True)+ type = graphene.String(description='A type of goods.', required=True)++ class Meta:+ description = 'Represents a reduced VAT rate for a particular type of goods.'diff --git a/saleor/graphql/core/types/shop.py b/saleor/graphql/core/types/shop.pynew file mode 100644index 0000000000..d2620a5ce5--- /dev/null+++ b/saleor/graphql/core/types/shop.py@@ -0,0 +1,102 @@+import graphene+from django_countries import countries+from django_prices_vatlayer import models as vatlayer_models+from django.conf import settings+from phonenumbers import COUNTRY_CODE_TO_REGION_CODE++from ....core.permissions import get_permissions+from ...utils import format_permissions_for_display+from .common import CountryDisplay, LanguageDisplay, PermissionDisplay+from .money import VAT+++class Domain(graphene.ObjectType):+ host = graphene.String(+ description='The host name of the domain.', required=True)+ ssl_enabled = graphene.Boolean(+ description='Inform if SSL is enabled.', required=True)+ url = graphene.String(+ description='Shop\'s absolute URL.', required=True)++ class Meta:+ description = 'Represents shop\'s domain.'+++class Shop(graphene.ObjectType):+ countries = graphene.List(+ CountryDisplay, description='List of countries available in the shop.',+ required=True)+ currencies = graphene.List(+ graphene.String, description='List of available currencies.',+ required=True)+ default_currency = graphene.String(+ description='Default shop\'s currency.', required=True)+ description = graphene.String(description='Shop\'s description.')+ domain = graphene.Field(+ lambda: Domain, required=True, description='Shop\'s domain data.')+ languages = graphene.List(+ LanguageDisplay,+ description='List of the shops\'s supported languages.', required=True)+ name = graphene.String(description='Shop\'s name.', required=True)+ permissions = graphene.List(+ PermissionDisplay, description='List of available permissions.',+ required=True)+ phone_prefixes = graphene.List(+ graphene.String, description='List of possible phone prefixes.',+ required=True)+ tax_rates = graphene.List(+ lambda: VAT, description='List of VAT tax rates configured in the shop.',+ required=True)+ tax_rate = graphene.Field(+ lambda: VAT, description='VAT tax rates for a specific country.',+ required=True, country_code=graphene.Argument(graphene.String))++ class Meta:+ description = '''+ Represents a shop resource containing general shop\'s data+ and configuration.'''++ def resolve_countries(self, info):+ return [+ CountryDisplay(code=country[0], country=country[1])+ for country in countries]++ def resolve_currencies(self, info):+ return settings.AVAILABLE_CURRENCIES++ def resolve_domain(self, info):+ site = info.context.site+ return Domain(+ host=site.domain,+ ssl_enabled=settings.ENABLE_SSL,+ url=info.context.build_absolute_uri('/'))++ def resolve_default_currency(self, info):+ return settings.DEFAULT_CURRENCY++ def resolve_description(self, info):+ return info.context.site.settings.description++ def resolve_languages(self, info):+ return [+ LanguageDisplay(code=language[0], language=language[1])+ for language in settings.LANGUAGES]++ def resolve_name(self, info):+ return info.context.site.name++ def resolve_permissions(self, info):+ permissions = get_permissions()+ return format_permissions_for_display(permissions)++ def resolve_phone_prefixes(self, info):+ return list(COUNTRY_CODE_TO_REGION_CODE.keys())++ def resolve_tax_rates(self, info):+ return vatlayer_models.VAT.objects.order_by('country_code')++ def resolve_tax_rate(self, info, country_code):+ # country codes for VAT rates are stored uppercase+ country_code = country_code.upper()+ return vatlayer_models.VAT.objects.filter(+ country_code=country_code).first()diff --git a/saleor/graphql/discount/mutations.py b/saleor/graphql/discount/mutations.pyindex 08bf1a574a..d3ea04aaf2 100644--- a/saleor/graphql/discount/mutations.py+++ b/saleor/graphql/discount/mutations.py@@ -2,7 +2,7 @@ import graphenefrom ...discount import VoucherType, modelsfrom ..core.mutations import ModelDeleteMutation, ModelMutation-from ..core.types import Decimal+from ..core.types.common import Decimalfrom .types import ApplyToEnum, DiscountValueTypeEnum, VoucherTypeEnumdiff --git a/saleor/graphql/discount/types.py b/saleor/graphql/discount/types.pyindex 2782d1db17..6274cce7f3 100644--- a/saleor/graphql/discount/types.py+++ b/saleor/graphql/discount/types.py@@ -3,7 +3,7 @@ from graphene import relayfrom ...discount import (DiscountValueType, VoucherApplyToProduct, VoucherType, models)-from ..core.types import CountableDjangoObjectType+from ..core.types.common import CountableDjangoObjectTypeclass Voucher(CountableDjangoObjectType):diff --git a/saleor/graphql/menu/types.py b/saleor/graphql/menu/types.pyindex a90cc2e273..f3a31bfcb0 100644--- a/saleor/graphql/menu/types.py+++ b/saleor/graphql/menu/types.py@@ -2,7 +2,7 @@ import graphenefrom graphene import relayfrom ...menu import models-from ..core.types import CountableDjangoObjectType+from ..core.types.common import CountableDjangoObjectTypeclass Menu(CountableDjangoObjectType):diff --git a/saleor/graphql/order/mutations/draft_orders.py b/saleor/graphql/order/mutations/draft_orders.pyindex f57b6e2ec2..560bfbca29 100644--- a/saleor/graphql/order/mutations/draft_orders.py+++ b/saleor/graphql/order/mutations/draft_orders.py@@ -3,17 +3,16 @@ from django.utils.translation import pgettext_lazyfrom graphene.types import InputObjectTypefrom graphql_jwt.decorators import permission_required-from saleor.account.models import Address-from saleor.core.exceptions import InsufficientStock-from saleor.core.utils.taxes import ZERO_TAXED_MONEY-from saleor.graphql.core.mutations import (- BaseMutation, ModelDeleteMutation, ModelMutation)-from saleor.graphql.core.types import Decimal, Error-from saleor.graphql.order.types import Order-from saleor.graphql.product.types import ProductVariant-from saleor.graphql.utils import get_node, get_nodes-from saleor.order import OrderStatus, models-from saleor.order.utils import add_variant_to_order, recalculate_order+from ....account.models import Address+from ....core.exceptions import InsufficientStock+from ....core.utils.taxes import ZERO_TAXED_MONEY+from ....order import OrderStatus, models+from ....order.utils import add_variant_to_order, recalculate_order+from ...core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation+from ...core.types.common import Decimal, Error+from ...product.types import ProductVariant+from ...utils import get_node, get_nodes+from ..types import Orderclass AddressInput(graphene.InputObjectType):diff --git a/saleor/graphql/order/mutations/fulfillments.py b/saleor/graphql/order/mutations/fulfillments.pyindex 448b92bb5b..fcfeef2043 100644--- a/saleor/graphql/order/mutations/fulfillments.py+++ b/saleor/graphql/order/mutations/fulfillments.py@@ -3,13 +3,13 @@ from django.utils.translation import npgettext_lazy, pgettext_lazyfrom graphql_jwt.decorators import permission_requiredfrom ....dashboard.order.utils import fulfill_order_line-from ....graphql.core.mutations import BaseMutation, ModelMutation-from ....graphql.core.types import Error-from ....graphql.order.types import Fulfillment-from ....graphql.utils import get_node, get_nodesfrom ....order import modelsfrom ....order.emails import send_fulfillment_confirmationfrom ....order.utils import cancel_fulfillment, update_order_status+from ...core.mutations import BaseMutation, ModelMutation+from ...core.types.common import Error+from ...order.types import Fulfillment+from ...utils import get_node, get_nodesfrom ..types import OrderLinediff --git a/saleor/graphql/order/mutations/orders.py b/saleor/graphql/order/mutations/orders.pyindex 7f786d7573..86e7284bd3 100644--- a/saleor/graphql/order/mutations/orders.py+++ b/saleor/graphql/order/mutations/orders.py@@ -6,7 +6,7 @@ from payments import PaymentError, PaymentStatusfrom ....order import CustomPaymentChoices, modelsfrom ....order.utils import cancel_orderfrom ...core.mutations import BaseMutation, ModelMutation-from ...core.types import Decimal, Error+from ...core.types.common import Decimal, Errorfrom ...order.mutations.draft_orders import DraftOrderUpdatefrom ...order.types import Orderfrom ...utils import get_nodediff --git a/saleor/graphql/order/types.py b/saleor/graphql/order/types.pyindex 7c9b0c1f6f..19815d303f 100644--- a/saleor/graphql/order/types.py+++ b/saleor/graphql/order/types.py@@ -3,7 +3,8 @@ from graphene import relayfrom graphene_django import DjangoObjectTypefrom ...order import models-from ..core.types import CountableDjangoObjectType, Money, TaxedMoney+from ..core.types.common import CountableDjangoObjectType+from ..core.types.money import Money, TaxedMoneyclass Order(CountableDjangoObjectType):diff --git a/saleor/graphql/page/mutations.py b/saleor/graphql/page/mutations.pyindex f347ec216b..113d903a67 100644--- a/saleor/graphql/page/mutations.py+++ b/saleor/graphql/page/mutations.py@@ -2,7 +2,7 @@ import graphenefrom ...page import modelsfrom ..core.mutations import ModelDeleteMutation, ModelMutation-from ..core.types import SeoInput+from ..core.types.common import SeoInputfrom ..core.utils import clean_seo_fieldsdiff --git a/saleor/graphql/page/types.py b/saleor/graphql/page/types.pyindex cd8151d490..e8d53f91d1 100644--- a/saleor/graphql/page/types.py+++ b/saleor/graphql/page/types.py@@ -1,7 +1,7 @@from graphene import relayfrom ...page import models-from ..core.types import CountableDjangoObjectType+from ..core.types.common import CountableDjangoObjectTypeclass Page(CountableDjangoObjectType):diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.pyindex dac4cc93ea..b0a4de34b5 100644--- a/saleor/graphql/product/mutations/products.py+++ b/saleor/graphql/product/mutations/products.py@@ -5,7 +5,7 @@ from graphql_jwt.decorators import permission_requiredfrom ....product import modelsfrom ...core.mutations import BaseMutation, ModelDeleteMutation, ModelMutation-from ...core.types import Decimal, Error, SeoInput+from ...core.types.common import Decimal, Error, SeoInputfrom ...core.utils import clean_seo_fieldsfrom ...file_upload.types import Uploadfrom ...utils import get_attributes_dict_from_list, get_node, get_nodesdiff --git a/saleor/graphql/product/types.py b/saleor/graphql/product/types.pyindex 0cbe619a67..745a50f4d9 100644--- a/saleor/graphql/product/types.py+++ b/saleor/graphql/product/types.py@@ -10,8 +10,8 @@ from ...product.utils.costs import (get_margin_for_variant, get_product_costs_data)from ..core.decorators import permission_requiredfrom ..core.filters import DistinctFilterSet-from ..core.types import (- CountableDjangoObjectType, Money, MoneyRange, TaxedMoney, TaxedMoneyRange)+from ..core.types.common import CountableDjangoObjectType+from ..core.types.money import Money, MoneyRange, TaxedMoney, TaxedMoneyRangefrom .filters import ProductFilterSetdiff --git a/saleor/graphql/shipping/mutations.py b/saleor/graphql/shipping/mutations.pyindex 8eb12771b1..2ae21a04b9 100644--- a/saleor/graphql/shipping/mutations.py+++ b/saleor/graphql/shipping/mutations.py@@ -2,7 +2,7 @@ import graphenefrom ...shipping import modelsfrom ..core.mutations import ModelDeleteMutation, ModelMutation-from ..core.types import Decimal+from ..core.types.common import Decimalclass ShippingPriceInput(graphene.InputObjectType):diff --git a/saleor/graphql/shipping/types.py b/saleor/graphql/shipping/types.pyindex aaf973f549..da2aab56b2 100644--- a/saleor/graphql/shipping/types.py+++ b/saleor/graphql/shipping/types.py@@ -3,7 +3,8 @@ from graphene import relayfrom graphene_django import DjangoObjectTypefrom ...shipping import models-from ..core.types import CountableDjangoObjectType, MoneyRange+from ..core.types.common import CountableDjangoObjectType+from ..core.types.money import MoneyRangeclass ShippingMethod(CountableDjangoObjectType):diff --git a/saleor/graphql/utils.py b/saleor/graphql/utils.pyindex be8234ef84..03d29cd91c 100644--- a/saleor/graphql/utils.py+++ b/saleor/graphql/utils.py@@ -6,7 +6,7 @@ from graphene_django.registry import get_global_registryfrom graphql_relay import from_global_idfrom ..product.models import AttributeChoiceValue, ProductAttribute-from .core.types import PermissionDisplay+from .core.types.common import PermissionDisplayregistry = get_global_registry()