Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Inconsistent Graphql Bulk Query responses

Inconsistent Graphql Bulk Query responses

nitsnets
Shopify Partner
3 0 0

We have inconsistent experience with Shopify's bulk query responses. We have a job running every hour to get the products from our store (always the same query) and sometimes we don't get information about some products and the next hour they are back:
1- objectCount:760146
2- objectCount:740355
3- objectCount:760146

This happens randomly; some days it goes well; some days it fails one hour but not the next...it doesn't seem to always happen at the same time.

 

It is not related to the removal or deactivation of products or collections. It even happens at times when there are no users working on the store in Shopify.

 

Did it happen to someoneelse? How do I solve it?

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1453 238 527

Hi @nitsnets 👋

When bulk querying products, both `rootObjectCount` and `objectCount` will change if there are any changes to the products on the store. As you mentioned, since no products were removed between the queries, `rootObjectCount` is likely remaining the same. Whereas `objectCount` field can vary based on the changes to the nested objects/fields being queried. 

 

For example, if the query includes product images, changes to the number of product images would change the object count. Even if merchant staff aren't actively working on the store,  a query requesting collections with a stock-level dependent condition can change based on customer purchases (e.g. a product no longer being included in an "in-stock" collection due to customers purchasing all available quantities). Similar would hold true for collections with metafield conditions.

 

Also keep in mind that both counts are expected to continuously change until the bulk operation is completed.

 

Hope that helps!

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

nitsnets
Shopify Partner
3 0 0

Hello.

The ObjectCount property was just the simplest way I tried to show what is happening, but the problem itself is that we don't get some products even if no changes were made to them or nested objects (images, variants, collections). .

We just don't get them on one of the calls and then on the next one they come back again.

Obviously we wait for the BULK process to be complete to get the JSONL file and process it.

 

Why might this happen?

 

Thanks, Omar (from Nitsnets)

ShopifyDevSup
Shopify Staff
1453 238 527

Hi @nitsnets ,

 

In order to give you the most effective troubleshooting related to your query and the discrepancies you are seeing, I would suggest contact our Partner Specialists via your Partner Dashboard under 'support'. 

 

From there we can gather some technical details on the query, store and timestamp and we can then have a look at our internal logs and take it to our developers look at it closely. 

 

Hope that helps! 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

PranavAggarwal
Shopify Partner
1 0 0

Hi @nitsnets. @ShopifyDevSup 

Did your issue got resolved? I'm also getting a similar issue in my bulkquery. I'm trying to get all the products --> variants --> inventoryItem --> inventoryLevels --> locations and available quantity.

So basically many of my skus are present at many locations. The bulkquery doesn't retrieve the locations which are not activated for the particular sku(inventoryitem) which is the ideal behavior of bulkquery. But once I activate some of the locations for the skus, the bulkquery should give me the updated results with more active locations.

Sometimes I get the correct data and then again it gives me the incomplete data in the bulkquery with missing locations(not present in the bulkquery) which are already active and also have some inventory on them.