Set Timeout on apollo-server-lambda

Hi all!

I was wondering if it is possible to keep my apollo-server-lambda server from timing out after 30 seconds? My design techniques aside, I cannot seem to figure it out.

I have seen two people who seem to have figured it out in express, so I am sure there is a way.

The first way was to use the setTimeout function. This does not seem to be present on the lambda package, so maybe there is a way to set this that I am unaware of?

The second is manually creating the Engine, and setting it in here like
origin: {
requestTimeout: ā€œ50sā€
}

I am not sure I fully understand this approach or how to do it for this package however. node.js - Apollo Server timeout while waiting for stream data - Stack Overflow

Any help is greatly appreciated!

Just wondering if you were able to solve this @Coby_Forrester ? Iā€™m running into same issue.

So my issue was actually that cloudfront was throwing the 30 second timeout issue. I needed to aggregate csv data for a user and it was taking way too long. I resolved it by running an async task worker that the lambda triggered for that query that did some work and ultimately sent an email to the user that their file was ready with a download link.

I think the best way is to just try to make each request well under 30 seconds

1 Like