i'm using geocode api which have 10 request per second with in gatsby, i'm creating pages during develop
, inside map function i'm calling geocode api to get the lat
,lon
from address to pass it to context
for each page
but i'm hitting api limit 10 request per second, tried with enter link description here
but i think i'm doing it wrong, because page creation failed
"gatsby-node.js" threw an error while running the createPages lifecycle:
const getAllData = async () =>
Promise.all(
//data from graphql
data.map(async (node) => {
//googleapi function send fetch request to api
const geo = await limiter.schedule(() => googleapi({ address }));
results = await anotherapi_base_on_res(res.latitude, res.longitude);
return {
path: `/${slug}`,
component: require.resolve(`./src/templates/abc.js`),
context: {
slug: node.url,
},
};
})
);
const dataResult = await getAllData();
pages are not being created, is it the right way to use Bottleneck