Hi
i have to publish a product
gid://shopify/BulkOperation/3300162208050.
i have use this approch with two strategies:
- Fields on Products create (deprecated)
“productPublications”: [{ “publicationId”: str(publication_id) }],
- 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!