Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/saleor_mcp/graphql/ChannelCreate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
mutation ChannelCreate($input: ChannelCreateInput!) {
channelCreate(input: $input) {
channel {
id
slug
name
isActive
currencyCode
defaultCountry {
code
}
}
errors {
field
message
code
}
}
}

20 changes: 20 additions & 0 deletions src/saleor_mcp/graphql/ListShippingZones.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
query ListShippingZones($first: Int = 20) {
shippingZones(first: $first) {
edges {
node {
id
name
warehouses {
id
name
}
channels {
id
name
slug
}
}
}
}
}

26 changes: 26 additions & 0 deletions src/saleor_mcp/graphql/ProductChannelListingUpdate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mutation ProductChannelListingUpdate($id: ID!, $input: ProductChannelListingUpdateInput!) {
productChannelListingUpdate(id: $id, input: $input) {
product {
id
name
channelListings {
id
channel {
id
slug
name
}
isPublished
isAvailableForPurchase
visibleInListings
}
}
errors {
field
message
code
channels
}
}
}

19 changes: 19 additions & 0 deletions src/saleor_mcp/graphql/ProductCreate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mutation ProductCreate($input: ProductCreateInput!) {
productCreate(input: $input) {
product {
id
name
slug
productType {
id
name
}
}
errors {
field
message
code
}
}
}

18 changes: 18 additions & 0 deletions src/saleor_mcp/graphql/ProductTypeCreate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
mutation ProductTypeCreate($input: ProductTypeInput!) {
productTypeCreate(input: $input) {
productType {
id
name
slug
isDigital
isShippingRequired
hasVariants
}
errors {
field
message
code
}
}
}

26 changes: 26 additions & 0 deletions src/saleor_mcp/graphql/ProductVariantChannelListingUpdate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
mutation ProductVariantChannelListingUpdate($id: ID!, $input: [ProductVariantChannelListingAddInput!]!) {
productVariantChannelListingUpdate(id: $id, input: $input) {
variant {
id
name
channelListings {
id
channel {
id
slug
}
price {
amount
currency
}
}
}
errors {
field
message
code
channels
}
}
}

19 changes: 19 additions & 0 deletions src/saleor_mcp/graphql/ProductVariantCreate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
mutation ProductVariantCreate($input: ProductVariantCreateInput!) {
productVariantCreate(input: $input) {
productVariant {
id
name
sku
product {
id
name
}
}
errors {
field
message
code
}
}
}

23 changes: 23 additions & 0 deletions src/saleor_mcp/graphql/ShippingZoneUpdate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
mutation ShippingZoneUpdate($id: ID!, $input: ShippingZoneUpdateInput!) {
shippingZoneUpdate(id: $id, input: $input) {
shippingZone {
id
name
warehouses {
id
name
}
channels {
id
name
slug
}
}
errors {
field
message
code
}
}
}

2 changes: 2 additions & 0 deletions src/saleor_mcp/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from saleor_mcp.tools import (
channels_router,
customers_router,
mutations_router,
orders_router,
products_router,
utils_router,
Expand All @@ -17,6 +18,7 @@
mcp.add_middleware(DetailedTimingMiddleware())
mcp.mount(channels_router)
mcp.mount(customers_router)
mcp.mount(mutations_router)
mcp.mount(orders_router)
mcp.mount(products_router)
mcp.mount(utils_router)
Expand Down
76 changes: 76 additions & 0 deletions src/saleor_mcp/saleor_client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

from .async_base_client import AsyncBaseClient
from .base_model import BaseModel, Upload
from .channel_create import (
ChannelCreate,
ChannelCreateChannelCreate,
ChannelCreateChannelCreateChannel,
ChannelCreateChannelCreateChannelDefaultCountry,
ChannelCreateChannelCreateErrors,
)
from .client import Client
from .count_orders import CountOrders, CountOrdersOrders
from .enums import (
Expand Down Expand Up @@ -543,6 +550,43 @@
ListStocksStocksEdgesNodeWarehouse,
ListStocksStocksPageInfo,
)
from .product_channel_listing_update import (
ProductChannelListingUpdate,
ProductChannelListingUpdateProductChannelListingUpdate,
ProductChannelListingUpdateProductChannelListingUpdateErrors,
ProductChannelListingUpdateProductChannelListingUpdateProduct,
ProductChannelListingUpdateProductChannelListingUpdateProductChannelListings,
ProductChannelListingUpdateProductChannelListingUpdateProductChannelListingsChannel,
)
from .product_create import (
ProductCreate,
ProductCreateProductCreate,
ProductCreateProductCreateErrors,
ProductCreateProductCreateProduct,
ProductCreateProductCreateProductProductType,
)
from .product_type_create import (
ProductTypeCreate,
ProductTypeCreateProductTypeCreate,
ProductTypeCreateProductTypeCreateErrors,
ProductTypeCreateProductTypeCreateProductType,
)
from .product_variant_channel_listing_update import (
ProductVariantChannelListingUpdate,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdate,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdateErrors,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariant,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListings,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListingsChannel,
ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListingsPrice,
)
from .product_variant_create import (
ProductVariantCreate,
ProductVariantCreateProductVariantCreate,
ProductVariantCreateProductVariantCreateErrors,
ProductVariantCreateProductVariantCreateProductVariant,
ProductVariantCreateProductVariantCreateProductVariantProduct,
)
from .warehouse_details import (
WarehouseDetails,
WarehouseDetailsWarehouse,
Expand Down Expand Up @@ -615,6 +659,11 @@
"CategorySortField",
"CategorySortingInput",
"CategoryWhereInput",
"ChannelCreate",
"ChannelCreateChannelCreate",
"ChannelCreateChannelCreateChannel",
"ChannelCreateChannelCreateChannelDefaultCountry",
"ChannelCreateChannelCreateErrors",
"ChannelCreateInput",
"ChannelDeleteInput",
"ChannelErrorCode",
Expand Down Expand Up @@ -911,8 +960,19 @@
"ProductBulkTranslateInput",
"ProductChannelListingAddInput",
"ProductChannelListingCreateInput",
"ProductChannelListingUpdate",
"ProductChannelListingUpdateInput",
"ProductChannelListingUpdateProductChannelListingUpdate",
"ProductChannelListingUpdateProductChannelListingUpdateErrors",
"ProductChannelListingUpdateProductChannelListingUpdateProduct",
"ProductChannelListingUpdateProductChannelListingUpdateProductChannelListings",
"ProductChannelListingUpdateProductChannelListingUpdateProductChannelListingsChannel",
"ProductCreate",
"ProductCreateInput",
"ProductCreateProductCreate",
"ProductCreateProductCreateErrors",
"ProductCreateProductCreateProduct",
"ProductCreateProductCreateProductProductType",
"ProductErrorCode",
"ProductFieldEnum",
"ProductFilterInput",
Expand All @@ -925,6 +985,10 @@
"ProductStockFilterInput",
"ProductTranslateErrorCode",
"ProductTypeConfigurable",
"ProductTypeCreate",
"ProductTypeCreateProductTypeCreate",
"ProductTypeCreateProductTypeCreateErrors",
"ProductTypeCreateProductTypeCreateProductType",
"ProductTypeEnum",
"ProductTypeFilterInput",
"ProductTypeInput",
Expand All @@ -936,8 +1000,20 @@
"ProductVariantBulkTranslateInput",
"ProductVariantBulkUpdateInput",
"ProductVariantChannelListingAddInput",
"ProductVariantChannelListingUpdate",
"ProductVariantChannelListingUpdateInput",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdate",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdateErrors",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariant",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListings",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListingsChannel",
"ProductVariantChannelListingUpdateProductVariantChannelListingUpdateVariantChannelListingsPrice",
"ProductVariantCreate",
"ProductVariantCreateInput",
"ProductVariantCreateProductVariantCreate",
"ProductVariantCreateProductVariantCreateErrors",
"ProductVariantCreateProductVariantCreateProductVariant",
"ProductVariantCreateProductVariantCreateProductVariantProduct",
"ProductVariantFilterInput",
"ProductVariantInput",
"ProductVariantSortField",
Expand Down
40 changes: 40 additions & 0 deletions src/saleor_mcp/saleor_client/channel_create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Generated by ariadne-codegen
# Source: src/saleor_mcp/graphql

from typing import List, Optional

from .base_model import BaseModel
from .enums import ChannelErrorCode


class ChannelCreate(BaseModel):
channelCreate: Optional["ChannelCreateChannelCreate"]


class ChannelCreateChannelCreate(BaseModel):
channel: Optional["ChannelCreateChannelCreateChannel"]
errors: List["ChannelCreateChannelCreateErrors"]


class ChannelCreateChannelCreateChannel(BaseModel):
id: str
slug: str
name: str
isActive: bool
currencyCode: str
defaultCountry: "ChannelCreateChannelCreateChannelDefaultCountry"


class ChannelCreateChannelCreateChannelDefaultCountry(BaseModel):
code: str


class ChannelCreateChannelCreateErrors(BaseModel):
field: Optional[str]
message: Optional[str]
code: ChannelErrorCode


ChannelCreate.model_rebuild()
ChannelCreateChannelCreate.model_rebuild()
ChannelCreateChannelCreateChannel.model_rebuild()
Loading