Mechanic now supports Shopify bulk operation mutations
Mechanic can now monitor Shopify
bulkOperationRunMutation
jobs the same way it already monitors bulk operation queries, and return the completed JSONL results to your task using the existing mechanic/shopify/bulk_operation
event.Bulk operation mutations are useful when you need to run the same Shopify Admin API mutation many times. Your task prepares a JSONL file where each line contains the variables for one mutation run, uploads that file to Shopify, starts the bulk mutation, and then waits for Shopify to finish processing it asynchronously.
How it works
- Create a staged upload in Shopify.
- Upload a JSONL variables file.
- Start bulkOperationRunMutationwith the staged upload path.
- Wait for Mechanic to receive the completed mechanic/shopify/bulk_operationevent.
- Read the completed results from bulkOperation.objects.
Each result object represents the GraphQL response for one JSONL input line. This lets your task inspect which mutation runs succeeded, and which returned GraphQL errors or mutation
userErrors
.This uses the same
bulkOperation
variable as bulk operation queries. If a task handles both operation types, check bulkOperation.type
: QUERY
for bulk operation queries, or MUTATION
for bulk operation mutations.Code editor snippets
We also added task code editor snippets for common bulk operation starters:
boilerplate:bulk_operation_query
boilerplate:staged_upload_jsonl
boilerplate:bulk_operation_mutation
Learn more