Changing smart collections, request collection isRebuilding state

Tourist
6 0 0

Whenever a smart collections filter criterias are change, it needs to rebuild.

When checking the network requests in the admin page, I see a request to https://ibdmw.myshopify.com/admin/internal/web/graphql/core with a response field {"data": {"collection": {"isRebuilding": true, ...}}}.

Is there a way to query the rebuilding status of the collection in GraphQl? I checked all versions including release candidate on GraphiQl to no avail.

0 Likes
Shopify Staff
Shopify Staff
96 17 20

Hi @Andreas_Sch ,

 

The "isRebuilding" field of a Collection GraphQL object is an internal field that can only be queried from within the Shopify platform. That means you cannot make a GraphQL query request for this field directly from the API through your own personal app. However you can use the Shopify GraphiQL app from the app store to perform a GraphQL query for this field (since the Shopify GraphiQL app lives internally within the platform): https://screenshot.click/19-11-wwv6q-mihl0.png

 

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

0 Likes
Tourist
6 0 0

Hi Hassain,

Thanks for your reply!

This means, there is do direct way to know wheather a change on the ruleSet of a collection is finished or not.

The only way that comes to my mind to identify this would be to query the size of the collection.productCount again and again, till there is no change in the size anymore.

Is it planned to make the field isRebuilding public anytime soon?

Best,

Andreas

0 Likes
Shopify Staff
Shopify Staff
96 17 20

Hey @Andreas_Sch ,

 

That is correct. Checking the product size of collection is probably your best bet to knowing if it has finished rebuilding. The `updatedAt` field in the Collections object might also be able to help you out here. As far as I know there are no plans to update this, but you can always keep an eye out on our change log to see if Shopify makes a change for this (https://changelog.shopify.com/)

 

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

0 Likes