Hello,
I got an error trying to execute bulkOperationRunMutation to create many fulfillments in one request.
Here is what I did so you have a bit of context:
- stagedUploadCreate with these input:
"input":
[
{
"filename":"bulk_fulfillment_create_variables",
"httpMethod":"POST",
"resource":"BULK_MUTATION_VARIABLES",
"mimeType":"text/jsonl"
}
]
This worked.
- Upload my jsonl file using the https://shopify-staged-uploads.storage.googleapis.com url and using the parameters from the response of the stagedUploadsCreate to send via multiparts/form-data
This worked as well and I can see the file I upload by visting the url returned by this request
Here is an example of file i’ve uploaded:
{"lineItemsByFulfillmentOrder":[{"fulfillmentOrderId":"gid://shopify/FulfillmentOrder/MY_FULFILLMENT_ORDER_ID_1"}],"trackingInfo":{"numbers":["MY_TRACKING_NUMBER_1"],"urls":["https://my.tracking.url/1"]},"notifyCustomer":true}
{"lineItemsByFulfillmentOrder":[{"fulfillmentOrderId":"gid://shopify/FulfillmentOrder/MY_FULFILLMENT_ORDER_ID_2"},{"fulfillmentOrderId":"MY_FULFILLMENT_ORDER_ID_2_1"}],"trackingInfo":{"numbers":["MY_TRACKING_NUMBER_2"],"urls":["https://my.tracking.url/2"]},"notifyCustomer":true}
{"lineItemsByFulfillmentOrder":[{"fulfillmentOrderId":"gid://shopify/FulfillmentOrder/MY_FULFILLMENT_ORDER_ID_3"}],"trackingInfo":{"numbers":["MY_TRACKING_NUMBER_3"],"urls":["https://my.tracking.url/3"]},"notifyCustomer":true}
- Execute BulkOperationRunMutation
This is the part where I have the error. Here is my graphql mutation:
mutation BulkOperationRunMutation {
bulkOperationRunMutation(
mutation: "mutation call($fulfillment: FulfillmentInput!) { fulfillmentCreate(fulfillment: $fulfillment) { fulfillment { id status } userErrors { message field } } }"
stagedUploadPath: "tmp/59879194782/bulk/74281d32-f408-46d0-8a1a-e9c0dff4d580/bulk_fulfillment_create_variables"
groupObjects: false
) {
bulkOperation {
createdAt
status
}
userErrors {
code
field
message
}
}
}
Here is the error I get when sending the mutation:
"data":
{
"bulkOperationRunMutation":
{
"bulkOperation":null,
"userErrors":
[
{
"message":"Invalid Bulk Mutation Field - Variable $input of type FulfillmentInput! was provided invalid value",
"field":null
}
]
}
}
Can someone help me on this ?
Thanks in advance !