New Shopify Certification now available: Liquid Storefronts for Theme Developers

Can't run bulk operation --"Failed to parse the mutation - Unexpected end of document"

Solved
Schmidtc63
Shopify Partner
48 7 14

query:

mutation {bulkOperationRunMutation(mutation: "mutation call($input: ProductInput!) {productUpdate(input: $input) {product  {id {variants(first: 20) {nodes {id sku}}}}}",   stagedUploadPath: "tmp/63578079486/bulk/62552451-7eba-4cc1-85df-c947a5559999/1669363450") {bulkOperation {id  url status} userErrors {message field}}}

response:

{"data":{"bulkOperationRunMutation":{"bulkOperation":null,"userErrors":[{"message":"Failed to parse the mutation - Unexpected end of document","field":null}]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0}}}}

input file:

{"input":{"id":"gid:\/\/shopify\/Product\/7931585659999","privateMetafields":[{"namespace": "product", "key": "matrixify", "valueInput": {"value": "1", "valueType": "STRING"}}]}}
{"input":{"id":"gid:\/\/shopify\/Product\/7931587499999","privateMetafields":[{"namespace": "product", "key": "matrixify", "valueInput": {"value": "1", "valueType": "STRING"}}]}}
{"input":{"id":"gid:\/\/shopify\/Product\/7931588119999","privateMetafields":[{"namespace": "product", "key": "matrixify", "valueInput": {"value": "1", "valueType": "STRING"}}]}}

 

The same query works on another store

I can verify the file from the "StagedUploadPath" exists. It returns the records I'd previously submitted.

I cannot find this error any place. There are not google references to it.

 

Thank you

Accepted Solution (1)
Schmidtc63
Shopify Partner
48 7 14

This is an accepted solution.

It was the callback query:  {product {id {variants(first: 20) {nodes {id sku}}}}}

Should have been  {product {id variants(first: 20) {nodes {id sku}}}}

 

However, the syntax error had absolutely nothing to do with "Failed to parse the mutation - Unexpected end of document". A little better error codes, Shopify. 

View solution in original post

Reply 1 (1)
Schmidtc63
Shopify Partner
48 7 14

This is an accepted solution.

It was the callback query:  {product {id {variants(first: 20) {nodes {id sku}}}}}

Should have been  {product {id variants(first: 20) {nodes {id sku}}}}

 

However, the syntax error had absolutely nothing to do with "Failed to parse the mutation - Unexpected end of document". A little better error codes, Shopify.