While attempting to transition my serverless nodejs graphql api to utilize typescript, I encountered an error in which serverless indicated that the graphql handler is not recognized as a function.
The following error message was generated:
Error: Serverless-offline: handler for 'hello' is not a function
at Object.createHandler (/home/savnik/serverless-webpack-typescript-apollo/node_modules/serverless-offline/src/functionHelper.js:221:11)
at handler (/home/savnik/serverless-webpack-typescript-apollo/node_modules/serverless-offline/src/ApiGateway.js:485:40)
at module.exports.internals.Manager.execute (/home/savnik/serverless-webpack-typescript-apollo/node_modules/@hapi/hapi/lib/toolkit.js:41:33)
at Object.internals.handler (/home/savnik/serverless-webpack-typescript-apollo/node_modules/@hapi/hapi/lib/handler.js:46:48)
at exports.execute (/home/savnik/serverless-webpack-typescript-apollo/node_modules/@hapi/hapi/lib/handler.js:31:36)
at Request._lifecycle (/home/savnik/serverless-webpack-typescript-apollo/node_modules/@hapi/hapi/lib/request.js:312:68)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at Request._execute (/home/savnik/serverless-webpack-typescript-apollo/node_modules/@hapi/hapi/lib/request.js:221:9)
The goal is to develop an apollo graphql api using typescript and have the ability to use it offline during development.
To demonstrate the issue, a replication has been created here: https://github.com/savnik/serverless-webpack-typescript-apollo
Any insights on the underlying cause of this problem would be appreciated.