Hello, I have created a Stack using the GraphQLApi...
# help
b
Hello, I have created a Stack using the GraphQLApi construct, and I linked my lambda function in the “server” property. This lambda function, has an async handler. The problem is that when i run it in debug mode, the following error is thrown:
Copy code
08581965-f277-4f60-9210-d7f52227e4b7 ERROR TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined 
 TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
    at new NodeError (internal/errors.js:322:7)
    at Function.from (buffer.js:334:9)
    at RuntimeClient._post (file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/RuntimeClient/RuntimeClient.js:133:42)
    at RuntimeClient.postInvocationResponse (file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/RuntimeClient/RuntimeClient.js:48:14)
    at complete (file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/CallbackContext.js:41:16)
    at done (file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/CallbackContext.js:66:13)
    at succeed (file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/CallbackContext.js:70:9)
    at file:///Users/gr33n/Documents/Dev/JS/prisma/node_modules/@serverless-stack/aws-lambda-ric/lib/Runtime/CallbackContext.js:112:24
>
I suspect that this is because I made the function endpoint async, is that possible? Thanks
t
Hey what version of sst are you on
b
Hey, this is the output:
SST: 1.2.15
CDK: 2.24.0
f
b
Thanks, I figured it out, it was the way I called the createHandler function of ApolloServer that was incorrect