Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Move StockInput and MoveProductInput from types to mutations file
IKarbowiak0989efaa55cf
diff --git a/saleor/graphql/product/bulk_mutations/products.py b/saleor/graphql/product/bulk_mutations/products.pyindex 28e5f170b8..856fcb3383 100644--- a/saleor/graphql/product/bulk_mutations/products.py+++ b/saleor/graphql/product/bulk_mutations/products.py@@ -31,8 +31,9 @@ from ..mutations.products import (AttributeValueInput,ProductVariantCreate,ProductVariantInput,+ StockInput,)-from ..types import ProductVariant, StockInput+from ..types import ProductVariantfrom ..utils import create_stocks, get_used_variants_attribute_valuesdiff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.pyindex fdf4bb25fe..72ae297ae2 100644--- a/saleor/graphql/product/mutations/products.py+++ b/saleor/graphql/product/mutations/products.py@@ -42,15 +42,7 @@ from ...core.utils import (from ...core.utils.reordering import perform_reorderingfrom ...meta.deprecated.mutations import ClearMetaBaseMutation, UpdateMetaBaseMutationfrom ...warehouse.types import Warehouse-from ..types import (- Category,- Collection,- MoveProductInput,- Product,- ProductImage,- ProductVariant,- StockInput,-)+from ..types import Category, Collection, Product, ProductImage, ProductVariantfrom ..utils import (create_stocks,get_used_attibute_values_for_variant,@@ -261,6 +253,18 @@ class CollectionDelete(ModelDeleteMutation):error_type_field = "product_errors"+class MoveProductInput(graphene.InputObjectType):+ product_id = graphene.ID(+ description="The ID of the product to move.", required=True+ )+ sort_order = graphene.Int(+ description=(+ "The relative sorting position of the product (from -inf to +inf) "+ "starting from the first given product's actual position."+ )+ )++class CollectionReorderProducts(BaseMutation):collection = graphene.Field(Collection, description="Collection from which products are reordered."@@ -541,6 +545,13 @@ class ProductInput(graphene.InputObjectType):)+class StockInput(graphene.InputObjectType):+ warehouse = graphene.ID(+ required=True, description="Warehouse in which stock is located."+ )+ quantity = graphene.Int(description="Quantity of items available for sell.")++class ProductCreateInput(ProductInput):product_type = graphene.ID(description="ID of the type that product belongs to.",diff --git a/saleor/graphql/product/types/__init__.py b/saleor/graphql/product/types/__init__.pyindex e5cf55dd64..b74a702812 100644--- a/saleor/graphql/product/types/__init__.py+++ b/saleor/graphql/product/types/__init__.py@@ -4,10 +4,8 @@ from .digital_contents import DigitalContent, DigitalContentUrlfrom .products import (Category,Collection,- MoveProductInput,Product,ProductImage,ProductType,ProductVariant,- StockInput,)diff --git a/saleor/graphql/product/types/products.py b/saleor/graphql/product/types/products.pyindex 8f73246045..8defa1fb65 100644--- a/saleor/graphql/product/types/products.py+++ b/saleor/graphql/product/types/products.py@@ -374,13 +374,6 @@ class ProductVariant(CountableDjangoObjectType):return graphene.Node.get_node_from_global_id(_info, root.id)-class StockInput(graphene.InputObjectType):- warehouse = graphene.ID(- required=True, description="Warehouse in which stock is located."- )- quantity = graphene.Int(description="Quantity of items available for sell.")--@key(fields="id")class Product(CountableDjangoObjectType):url = graphene.String(@@ -866,15 +859,3 @@ class ProductImage(CountableDjangoObjectType):@staticmethoddef __resolve_reference(root, _info, **_kwargs):return graphene.Node.get_node_from_global_id(_info, root.id)---class MoveProductInput(graphene.InputObjectType):- product_id = graphene.ID(- description="The ID of the product to move.", required=True- )- sort_order = graphene.Int(- description=(- "The relative sorting position of the product (from -inf to +inf) "- "starting from the first given product's actual position."- )- )