Inconsistent Graphql Bulk Query

Highlighted
New Member
5 0 0

I'm having extremely inconsistent experience with the Shopify bulk query. I'm doing multiple different queries every night. There are times where I get a response within minutes. Other times, within hours (sometimes up to 6 hours!). Furthermore, lately my requests are never completed. When I poll them, after 10-30 minutes, the operation status is "CANCELED." There is no error code given (it's null). The amount of data being requested varies in size, but some relatively small requests also run into this problem. Our backend APIs rely on data from Shopify, but lately, because of this problem, I can't retrieve the data. Has anyone else run into this problem? Is there a fix? Below is an example of a query I am doing.

 

 

mutation {
  bulkOperationRunQuery(
    query:"""
    {
      products(query:"updated_at:>'2020-07-01 12:00:00'") {
				edges{
					node{
						id
						title
						handle
						descriptionHtml
						vendor
						productType
						createdAt
						updatedAt
						publishedAt
						tags
						totalInventory
						hasOutOfStockVariants
						featuredImage {
							id
						}
						images {
							edges {
								node {
									id
									altText
									originalSrc
								}
							}
						}
						variants {
							edges{
								node{
									id
									title
									sku
									barcode
									createdAt
									updatedAt
									inventoryPolicy
									inventoryQuantity
									inventoryItem{
										id
										createdAt
										updatedAt
										sku
										duplicateSkuCount
										harmonizedSystemCode
										unitCost {
											amount
										}
										provinceCodeOfOrigin
									}
									price
									fulfillmentService {
										handle
									}
									selectedOptions{
										name
									}
									taxable
									taxCode
									weight
									weightUnit
									image{
										id
									}
								}
							}
						}
					}
				}
			}
    }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}

 

  

0 Likes
Highlighted
Shopify Staff
Shopify Staff
119 15 19

Hey @achempak 

Do you happen to have a request-id available (x-request-id response header) for one of the cancelled bulk jobs? It seems fairly normal that there may be a time discrepancy on how long they run, but if they are getting cancelled I can try and look into that for you. 

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes
Highlighted
New Member
5 0 0

Hi @Kevin_A ,

Thanks for the quick response! I'm not sure if this is the id you're looking for, but here are two examples from last night.

gid://shopify/BulkOperation/50948112446

gid://shopify/BulkOperation/50950045758

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
119 15 19

Hey @achempak 

Are you still seeing bulk operations being cancelled? Can you provide any recent IDs where you are seeing this happen?

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes