Warehouse Shipping Zone Assign Mutation (mutations/warehouse_shipping_zone_assign.py)

saleor · saleor/graphql/warehouse/mutations/warehouse_shipping_zone_assign.py · python · BSD-3-Clause
infra, integration, pos, auth, fw:django, tag:mutation, tag:shipping-zone

GraphQL mutation that assigns a shipping zone to a warehouse, validating warehouse count and permissions. Reuse for warehouse-shipping zone association in Saleor.

# Source: https://github.com/saleor/saleor | License: BSD-3-Clause | Copyright 2020-2023, Saleor Commerce
# Provided via justclaw.it.com; keep this notice with the code.
from collections import defaultdict

import graphene
from django.core.exceptions import ValidationError

from ....channel import models as channel_models
from ....permission.enums import ProductPermissions
from ....warehouse import models
from ....warehouse.error_codes import WarehouseErrorCode
from ....warehouse.validation import validate_warehouse_count
from ...account.i18n import I18nMixin
from ...core import ResolveInfo
from ...core.mutations import DeprecatedModelMutation
from ...core.types import NonNullList, WarehouseError
from ...shipping.types import ShippingZone
from ..types import Warehouse


class WarehouseShip

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key