Gadget syncing

So I run my own daily sync, and I've just noticed when Gadget makes the GraphQL calls to Shopify, its only using a page limit of 10? Why is this so low when you can request up to 250? Surely this would increase request time as its using a smaller page limit?
No description
15 Replies
Chocci_Milk
Chocci_Milk7mo ago
The internal sync logic doesn't affect your request time. The only thing that affects your request time is the amount of time that your actions run. I will however speak to the team to see if we should up the limit
ljspoor94
ljspoor94OP7mo ago
Okay so just to confirm, I use the following code and run it daily (as I've turned off product and inventory item webhooks)
await api.shopifySync.run({
shopifySync: {
domain: record.domain,
shop: {
_link: record.id
},
models: [
'shopifyProduct',
'shopifyProductOption',
'shopifyProductMedia',
'shopifyProductVariant',
'shopifyProductVariantMedia',
'shopifyInventoryItem'
]
}
});
await api.shopifySync.run({
shopifySync: {
domain: record.domain,
shop: {
_link: record.id
},
models: [
'shopifyProduct',
'shopifyProductOption',
'shopifyProductMedia',
'shopifyProductVariant',
'shopifyProductVariantMedia',
'shopifyInventoryItem'
]
}
});
So however long it takes to sync all of those models, it won't cost me request time?
Chocci_Milk
Chocci_Milk7mo ago
It will cost you request time but not because of the Gadget sync logic That would be outrageous
ljspoor94
ljspoor94OP7mo ago
How is that request time calculated then?
Chocci_Milk
Chocci_Milk7mo ago
The time that your action starts to run to the time that it ends
ljspoor94
ljspoor94OP7mo ago
So basically just the time it takes to 'init' that sync then?
Chocci_Milk
Chocci_Milk7mo ago
No Each action that runs If there are 2000 product updates, you'll be charged for 2000 action runtimes Any time your code runs you're charged usage
ljspoor94
ljspoor94OP7mo ago
Right so the time Gadget spends querying Shopify to get the products - I don't pay for this If Gadget retrieves 500 products - I pay for the 500 update actions? Did I get that right?
Chocci_Milk
Chocci_Milk7mo ago
Yes If our implementation is slow, that's our fault, not yours
ljspoor94
ljspoor94OP7mo ago
Okay great thanks! Would be interesting to know why Gadget only opted for a page size of 10!
Chocci_Milk
Chocci_Milk7mo ago
I'm waiting on a response from my team member
ljspoor94
ljspoor94OP7mo ago
Ok cool!
Chocci_Milk
Chocci_Milk7mo ago
The reason is for optimization of tokens used so that we can go to the fastest rate limit possible. Based on this line in the rate limiting cost calc docs: https://shopify.dev/docs/api/usage/rate-limits#cost-calculation
No description
ljspoor94
ljspoor94OP7mo ago
Good to know, thanks for the info!
Chocci_Milk
Chocci_Milk7mo ago
No problem

Did you find this page helpful?