Hello,
I’m currently experimenting with bulk operations to perform multiple mutations while having less API calls. My operations are being executed and perform the correct actions (as far as I can tell).
Problem
I’m unable to get/check the status of my bulk operations.
Here is my workflow:
Upload the file for my mutation
mutation ($input: [StagedUploadInput!]!) {
stagedUploadsCreate(input: $input) {
userErrors {
field
message
}
stagedTargets {
url
resourceUrl
parameters {
name
value
}
}
}
}
//$input
const uploadInput: StagedUploadInput = {
filename: "credits.json", httpMethod: "POST", mimeType: "text/jsonl", resource: "BULK_MUTATION_VARIABLES"
};
Notes
The upload request was send and the my file with metafield mutations is uploaded to the Shopify S3 Storage. Those two requests return a 2XX status code.
Starting the bulk operation
mutation ($mutation: String!, $stagedUploadPath: String!) {
bulkOperationRunMutation(
mutation: $mutation,
stagedUploadPath: $stagedUploadPath) {
bulkOperation {
id
url
status
}
userErrors {
message
field
}
}
}
$stagedUploadPath
is the path provided by the stagedUploadsCreate
Mutation and $mutation
is a mutation that updates metafields of dummy customers.
Response
{"data":{"bulkOperationRunMutation":{"bulkOperation":{"id":"gid://shopify/BulkOperation/6174703812940","url":null,"status":"CREATED"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0}}}}
Notes
The API returns no errors, so I guess my input was correct. After checking the dummy customers, the metafields are edited correctly, so the bulk operation is being executed and should finish successfully.
Checking the operation status
query single {
node(id: "gid://shopify/BulkOperation/6174703812940") {
... on BulkOperation {
url
partialDataUrl
completedAt
errorCode
id
}
}
}
Response
{
"data": {
"node": null
},
"extensions": {
"cost": {
"requestedQueryCost": 1,
"actualQueryCost": 1,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1999,
"restoreRate": 100
}
}
}
}
Notes
My expectation was to get the fields I requested and not null
.
Let me know if you need further information. I appreciate any help!