Syncing Product Table First Immediately after Install
In order to onboard on our app, a newly installed merchant store's products need to be fully synced. We've noticed it could take up to 2 mins to sync the merchant immediately after install causing a bad experience for the merchant.
We use api.shopifySync.run (see below).
1. Is this the right API to use or is the bulk api better?
2. Is there a way to prioritize syncing the product table first so merchant is unblocked from onboarding.
4 Replies
You can sync models specifically:
You could check for the sync to complete (polling?) and then schedule the next. Don't think you can enqueue syncs.
Personally, I show a banner in our apps while the first sync is running and block certain functionality. Using live query.
@Simon have you used the bulkRun api - is it better for such uses cases
ChatGPT recommended something like :
Where did you find this bulk run? I don't think thats even a thing.
And anyway, Gadget will most likely can't do it any faster as Shopify has rate limits
Agreed @ljspoor94, that's not a gadget thing. What gpt might be referring to is shopify bulkQeury. You could theortically spin one up yourself. It runs outside of the shopify rate limits, but you need to implement it yourself (initiate bulk query, poll for status or use your own webhook, get the data (JsonL), parse it, create records in gadget...
See also https://discord.com/channels/836317518595096598/1364902392671371306/1374311324414382124, but haven't done that myself... And it's not magic either, it still takes it time + for huuuge stores it could even fail bcs it times out after 10min... guess not an issue for products though.