I'm using the apollo-server-lambda module to create a lambda that connects to RDS database. The only way I can properly connect to the RDS is the following
exports.graphqlHandler = function(event, context, callback) {
context.callbackWaitsForEmptyEventLoop = false;
sequelize.authenticate()
.then(() => {
console.log('Connection has been established successfully.');
callback(null, "just stop!");
})
.catch(err => {
console.error('Unable to connect to the database:', err);
callback("error");
});
How can I do this using the Apollo server lambda createHandler method