A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We haven't made any changes on our end and it was working as-is prior to last night, so as of yesterday (6/1) there appears to be have been an update to the bulkOperationRunQuery query syntax. I figured I would post here incase anyone is running into the same problem or searching for a resolution.
We originally migrated our code from making multiple GraphQL query calls to use and benefit from bulkOperations; however, we had some remnant syntax in our code which appears to have worked up until last night.
Our api call to run a bulk operation query started returning the user error "Bulk query is not valid GraphQL":
{"userErrors":[{"field":["query"],"message":"Bulk query is not valid GraphQL"}]}
This is a slimmed down version of the actual query we were using:
mutation { bulkOperationRunQuery( query:""" { productVariants() { edges { node { id displayName barcode product { collections() { edges { node { title } } } } } } } } """ ) { bulkOperation { id status } userErrors { field message } } }
This will error due to the parenthesis on "collections()". As I mentioned this was left over from our original query where we used to pass additional parameters in, but worked up until last night.
Simply removing the "()" from collections fixed our bulkOperationRunQuery.
Hey @krchun,
Thanks for the post. The expected syntax for a bulk query shouldn't include the parenthesis, but I can definitely see how those could be left over when constructing the query. Hopefully this helps someone else as well.
JB | Solutions Engineer @ Shopify
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog