My Shopify store successfully creates collections, and the gadget syncs them immediately. However,
My Shopify store successfully creates collections, and the gadget syncs them immediately. However, when I create a blog post, it doesn't sync to the gadget.
What's usually wrong with this?tks
8 Replies
I’m not sure if there are any webhooks for blos/articles. Have you checked?
Some models are sync only. I believe that Blog is one of those models.
Take a look at this: https://docs.gadget.dev/guides/plugins/shopify/syncing-shopify-data#sync-only-models
If you look here, there are no webhooks for blogs: https://shopify.dev/docs/api/admin-graphql/2024-10/enums/WebhookSubscriptionTopic
Shopify
WebhookSubscriptionTopic - GraphQL Admin
The supported topics for webhook subscriptions. You can use webhook subscriptions to receive
notifications about particular events in a shop.
You create mandatory webhooks either via the
[Partner Dashboard](https://shopify.dev/apps/webhooks/confi...
Thank you so much,So I can update manually in gadget👍
i add the code
const shopId = connections.shopify.current ? connections.shopify.currentShopId : null;
const shopDomain = connections.shopify.current ? connections.shopify.currentShopDomain : null;
const syncSince = new Date ( ) ;
syncSince . setDate ( syncSince . getDate ( ) - 1 ) ; await api.shopifySync.run({ shopifySync: { domain: shopDomain, shop: { _link: shopId, }, models: ["shopifyArticle"], syncSince : syncSince . toISOString ( ) , }, }); and i see the log show sync for shop completed successfully, But in fact I found that the data was not synchronized to the gadget
syncSince . setDate ( syncSince . getDate ( ) - 1 ) ; await api.shopifySync.run({ shopifySync: { domain: shopDomain, shop: { _link: shopId, }, models: ["shopifyArticle"], syncSince : syncSince . toISOString ( ) , }, }); and i see the log show sync for shop completed successfully, But in fact I found that the data was not synchronized to the gadget

ok ,handled it change like this:
const resultsipo = await api.shopifySync.run({
shopifySync: {
domain: shopDomain,
shop: {
_link: shopId,
},
models: [
"shopifyArticle",
"shopifyBlog",
"shopifyCollect",
"shopifyComment",
"shopifyFile"
],
syncSince : syncSince . toISOString ( ) ,
},
});
I recommend that you don't fire off syncs to fill data as a result of another webhook. You should instead fetch from the Shopify API. Syncs will cause your request time to increase quite rapidly
ok,thks