A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi
i have to publish a product
gid://shopify/BulkOperation/3300162208050.
i have use this approch with two strategies:
1) Fields on Products create (deprecated)
2) or publishablePublish bulk mutation
in both cases with some data the result is always a
'id': 'gid://shopify/BulkOperation/3300162208050'
'type': 'MUTATION'
'status': 'FAILED'
'errorCode': 'INTERNAL_SERVER_ERROR'
'url': None
'rootObjectCount': '1'
Hi @DanubioBlu 👋
I would recommend trying the singleton mutation first to isolate any issues with the input variables, mutation format, access, etc. The error messaging from the a single mutation will provide more granular detail than the bulk operation failure.
Below is an example mutation to publish a product:
mutation ($id: ID!, $input: [PublicationInput!]!) {
publishablePublish(id: $id, input: $input) {
publishable {
... on Product { id }
}
userErrors {
field
message
}
}
}
with variables:
{
"id": "gid://shopify/Product/123",
"input": {
"publicationId": "gid://shopify/Publication/321"
}
}
The bulk mutation JSONL file for the same mutation should be formatted like this:
{"id": "gid://shopify/Product/123", "input": {"publicationId": "gid://shopify/Publication/321"}}
{"id": "gid://shopify/Product/456", "input": {"publicationId": "gid://shopify/Publication/654"}}
Hope that helps!
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog