shopifyProductVariant metafields fast sync methods

When I made a change to a variant metafield inside the Shopify admin, I must be able to see it in my Gadget database. I am working on this for like quite some time, but it never works. The only way to sync it is using the sync button in Gadget settings but it takes forever to sync all of the data. I just want to find the changed data and only sync one data. Is there a way to achieve this?
6 Replies
ljspoor94
ljspoor945w ago
Shopify don't emit webhooks for variant metafield updates so the only way is to perform a sync
eye of sauron
eye of sauronOP5w ago
That sucks. What if I just fetch this metafield directly from Shopify and bypass Gadget? Is that a good idea?
Anthony
Anthony5w ago
Shopify should emit webhooks if you're using productVariantsBulkUpdate to update your variant metafields. If you use metafieldSet - I don't believe a webhook is emitted
eye of sauron
eye of sauronOP4w ago
I'm using productVariantsBulkUpdate but couldn't manage to build a webhook, I can directly fetch from Shopify and fill my data, I will try to go that way. Still need to work with create() action under shopifyProductVariant though. Hopefully I can handle the webhook there.
Smelvin
Smelvin4w ago
Hi Shun/Sauron, You could utilize webhook filtering check for metafield updates, then if you preform a sync its more efficient I have a link to the webhook filter docs here: https://docs.gadget.dev/guides/plugins/shopify/shopify-webhooks#applying-a-webhook-filter
eye of sauron
eye of sauronOP4w ago
I did exactly that, thank you so much.

Did you find this page helpful?