1

I'm running a apollo-server-lambda locally in using serverless-offline. Even though the handler is being exported once, the serverless-offline code is fully recreating the ApolloServer for every request (which is causing my knex to create new DB connections and leak them). I'd expect it to keep the same ApolloServer.

How can I get serverless-offline to keep the same js instances between calls?

I'm guessing this can be reproduced by following any sort of serverless-offline examples. Here is an example:

https://medium.com/@gannochenko/how-to-use-graphql-apollo-server-with-serverless-606430ad94b3

Dan Hill
  • 143
  • 1
  • 1
  • 6

1 Answers1

0

It seems that Serverless-Offline does not simulate the execution context reuse:

https://github.com/dherault/serverless-offline/issues/363