Differences in shopifyProduct.Update action results from webhook trigger vs Shop Sync

Struggling to understand how Shop Sync works vs a regular web hook trigger. I've added some extra fields to ShopifyProduct and added logic to the create and update actions to fill them out. Now if i create/update a product within Shopify, to trigger the web hook, these fields are filled out perfectly. However if i run a Shop Sync, any existing records are not updated to include these. My current assumption is, Shop Sync is making API calls to Shopify to get the latest data and so does not receive all the same fields that a web hook trigger does? Is this correct and if so, how would be best to change how the Shop Syncs? The method is currently buried in the gadget-server/shopify package and I'm hesitant to change it. My first thought is that when shopifyProduct.update is called, it could run an additional API call in the on success part to get the extra information i need, if its come from a shopSync trigger. Feels very inefficient and a bit of an anti-pattern though to have data coming from Shopify and then to have to go and ask for extra for every product.
No description
1 Reply
shunt
shuntOP2mo ago
Ah figured it out: The issue was needing to add the 'force: true' to the sync run to force it to sync products which hadn't been updated since last sync. Leaving thread for others to learn from my idiocy.

Did you find this page helpful?