Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Remove products field from collectionUpdate mutation

oldPadavan97f66a57a148
diff --git a/saleor/graphql/product/mutations/products.py b/saleor/graphql/product/mutations/products.py
index 8c7fc774c9..2d2557e394 100644
--- a/saleor/graphql/product/mutations/products.py
+++ b/saleor/graphql/product/mutations/products.py
@@ -79,17 +79,20 @@ class CollectionInput(graphene.InputObjectType):
description='Informs whether a collection is published.')
name = graphene.String(description='Name of the collection.')
slug = graphene.String(description='Slug of the collection.')
+ background_image = Upload(description='Background image file.')
+ seo = SeoInput(description='Search engine optimization fields.')
+
+
+class CollectionCreateInput(CollectionInput):
products = graphene.List(
graphene.ID,
description='List of products to be added to the collection.',
name='products')
- background_image = Upload(description='Background image file.')
- seo = SeoInput(description='Search engine optimization fields.')
class CollectionCreate(ModelMutation):
class Arguments:
- input = CollectionInput(
+ input = CollectionCreateInput(
required=True,
description='Fields required to create a collection.')
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 8cbf250226..1ae0d5d0e8 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -322,6 +322,14 @@ type CollectionDelete {
}
input CollectionInput {
+ isPublished: Boolean
+ name: String
+ slug: String
+ backgroundImage: Upload
+ seo: SeoInput
+}
+
+input CollectionCreateInput {
isPublished: Boolean
name: String
slug: String
@@ -696,7 +704,7 @@ type Mutations {
addressCreate(input: AddressCreateInput!): AddressCreate
addressUpdate(id: ID!, input: AddressInput!): AddressUpdate
addressDelete(id: ID!): AddressDelete
- collectionCreate(input: CollectionInput!): CollectionCreate
+ collectionCreate(input: CollectionCreateInput!): CollectionCreate
collectionUpdate(id: ID!, input: CollectionInput!): CollectionUpdate
collectionDelete(id: ID!): CollectionDelete
collectionAddProducts(collectionId: ID!, products: [ID]!): CollectionAddProducts