Are RW graphql queries the right way to query external APIs?

Hi

I have built a proof of concept app that relies on external data using an API. I followed this helpful tutorial.

In my case I also cached the results in database tables so that I don’t have to query the external API every time I need the information. This approach works great in my local environment but I have run into function timeout errors when I deploy to Netlify.

I have signed up for a pro plan on Netlify and this will allow me to extend the timeout slightly.

But now I am wondering if I made the right design approach using this approach as I understand that lambda functions charge by execution time.

Any advice on alternative approaches that might be worth considering?

Thanks

I understand that RW encourage us to interact with the backend thru GraphQL…

previously we call our rest api right from the front, now we still can do node fetch from the back, inside the services, which sits behind the graphql layer. so far i havent encounter any timeout errors with this approach. this design seems to work. but knowing that React Server Component is coming, things might change…

there’s hope that we can do how we used to do it, on the server side, without graphql…