You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initially I've had most queries in gatsby-node.js where I could just add sleep between calls and so far it was fine. But I found out that some more frequent changing data did not change on each build, presumably due to more heavy caching in the file. Then I switched to just querying the id in the gatsby-node.js and run the more complex queries as page queries. However now, as they all run in parallel and I have no control, Gatsby Cloud often complains "Query takes too long", presumably due to the rate limit of the API and Gatsby making complex calls in parallel.
I presume that this could be solved by having the page queries run sequentially, preferrably I'd also add a short delay between them (1-2s).
I do know that this is quite localized and specific, however I presume that if more and more people use the new source plugin which has the new rate limit (current source shopify plugin uses Storefront API that has a different rate limit).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have also posted the question on StackOverflow, the main question is:
Can we delay page queries or run them sequentially?
Background: We recently switched to
gatsby-source-shopify-experimental
, which uses Shopify's "Admin API" that has a rate limit.Initially I've had most queries in gatsby-node.js where I could just add sleep between calls and so far it was fine. But I found out that some more frequent changing data did not change on each build, presumably due to more heavy caching in the file. Then I switched to just querying the
id
in the gatsby-node.js and run the more complex queries as page queries. However now, as they all run in parallel and I have no control, Gatsby Cloud often complains "Query takes too long", presumably due to the rate limit of the API and Gatsby making complex calls in parallel.I presume that this could be solved by having the page queries run sequentially, preferrably I'd also add a short delay between them (1-2s).
I do know that this is quite localized and specific, however I presume that if more and more people use the new source plugin which has the new rate limit (current source shopify plugin uses Storefront API that has a different rate limit).
Beta Was this translation helpful? Give feedback.
All reactions