reactioncommerce/example-storefront

Run fetch calls in getStaticProps in parallel / Batch Queries

janus-reith opened this issue · 0 comments

Summary description

Run fetch calls in parallel

TBD: Refactor the whole logic to just batch all necessary queries into one call, to avoid several roundtrips altogether.
This will be especially notable when fallback rendering is happening and storefront and api have some network distance.

Rationale for why this feature is necessary

Currently. each GraphQL Query for SSG is awaited and then the next one is executed.

Expected use cases

Data fetching in getStaticProps, which needs to be for every page.

Additional context

Not sure if batching is an appropriate term here, as the goal would be to only have one batch ;)
Will probably solve this together with #703.