Anchor to collectionPublishcollection
collectionPublish
mutationDeprecated
Requires access scope. Also: The user must have a permission to publish a collection.
Publishes a collection to a channel. Use instead.
Anchor to Arguments
Arguments
- Anchor to inputinput•Collection
Publish requiredInput! Specify a collection to publish and the sales channels to publish it to.
Was this section helpful?
Anchor to CollectionPublishPayload returnsCollectionPublishPayload returns
- Anchor to collectioncollection•
The published collection.
- Anchor to collectionPublicationscollection•
Publications The channels where the collection has been published.
- Anchor to shopshop•Shop!non-null
The shop associated with the collection.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
Mutation Reference
1mutation collectionPublish($input: CollectionPublishInput!) {2 collectionPublish(input: $input) {3 collection {4 # Collection fields5 }6 collectionPublications {7 # CollectionPublication fields8 }9 shop {10 # Shop fields11 }12 userErrors {13 field14 message15 }16 }17}
Input
1{2 "input": {3 "collectionPublications": [4 {5 "channelHandle": "<your-channelHandle>",6 "channelId": "gid://shopify/<objectName>/10079785100",7 "publicationId": "gid://shopify/<objectName>/10079785100"8 }9 ],10 "id": "gid://shopify/<objectName>/10079785100"11 }12}
{
"input": {
"collectionPublications": [
{
"channelHandle": "<your-channelHandle>",
"channelId": "gid://shopify/<objectName>/10079785100",
"publicationId": "gid://shopify/<objectName>/10079785100"
}
],
"id": "gid://shopify/<objectName>/10079785100"
}
}
input CollectionPublishInput {
collectionPublications: [CollectionPublicationInput!]!
id: ID!
}
input CollectionPublicationInput {
channelHandle: String
channelId: ID
publicationId: ID
}