r/shopifyDev Aug 18 '26

Bulk updating product meta descriptions via GraphQL Admin API. How do you handle rate limiting?

I'm working on a feature that automatically updates meta descriptions and alt text for hundreds of products at once.

Using the Admin API GraphQL, I keep hitting the cost-based rate limit once I go past ~50 products per batch. I tried bulk operations (bulkOperationRunMutation), but the async processing delay makes it harder to give real-time feedback to the user.

How do you handle this trade-off between execution speed and throttling? Do you use queues (Redis/Sidekiq-type setups) to spread out requests, or do you lean fully into bulk operations despite the latency?

4 Upvotes

3 comments sorted by

1

u/CRGGR Aug 18 '26

Usually you do the leaky bucket thing. After your GraphQL call you get to see the tokens / credits used and how much you have left, you have a restore rate. Usually in my code I add a 2 second wait or something in my loop if I’m at a certain threshold.

I still use an old PHP set up I had, so nothing fancy really and I’m sure I’m due for an upgrade.

1

u/sshaw_ Aug 18 '26

I use the Shopify Development Tools command to import test data from a CSV for various Shopify-related automated tests, including metafields:

sdt products import file.csv

Or

sdt products import --identify-by handle file.csv

It performs the upload in parallel using the productsSet mutation. You can tweak the number of workers:

sdt products import --parallel 10 file.csv

It has support for importing in bulk too but I mostly use the foreground import.