Anchor to productPublishproduct
productPublish
mutationDeprecated
Requires access scope. Also: The user must have a permission to publish a product.
Publishes a product. Products that are sold exclusively on subscription () can only be published on online stores. Use
instead.
Anchor to Arguments
Arguments
- Anchor to inputinput•Product
Publish requiredInput! Specifies the product to publish and the channels to publish it to.
Was this section helpful?
Anchor to ProductPublishPayload returnsProductPublishPayload returns
- Anchor to productproduct•
The product that has been published.
- Anchor to shopshop•Shop!non-null
The user's shop.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
- Anchor to productPublicationsproduct•
Publications [ProductPublication!] Deprecated The channels where the product is published.
Was this section helpful?
Mutation Reference
1mutation productPublish($input: ProductPublishInput!) {2 productPublish(input: $input) {3 product {4 # Product fields5 }6 productPublications {7 # ProductPublication fields8 }9 shop {10 # Shop fields11 }12 userErrors {13 field14 message15 }16 }17}
Input
1{2 "input": {3 "id": "gid://shopify/<objectName>/10079785100",4 "productPublications": [5 {6 "channelHandle": "<your-channelHandle>",7 "channelId": "gid://shopify/<objectName>/10079785100",8 "publicationId": "gid://shopify/<objectName>/10079785100",9 "publishDate": "2019-09-07T15:50:00Z"10 }11 ]12 }13}
{
"input": {
"id": "gid://shopify/<objectName>/10079785100",
"productPublications": [
{
"channelHandle": "<your-channelHandle>",
"channelId": "gid://shopify/<objectName>/10079785100",
"publicationId": "gid://shopify/<objectName>/10079785100",
"publishDate": "2019-09-07T15:50:00Z"
}
]
}
}
input ProductPublishInput {
id: ID!
productPublications: [ProductPublicationInput!]!
}
input ProductPublicationInput {
channelHandle: String
channelId: ID
publicationId: ID
publishDate: DateTime
}