Hi guys, I am missing (or overlooked) an example h...
# help
m
Hi guys, I am missing (or overlooked) an example how to connect appsync with a lamda function. Basically what's the correct signature to use here:
Copy code
// import { APIGatewayProxyHandlerV2 } from "aws-lambda";
// import { AppSyncResolverHandler } from "aws-lambda";

export const main: any /* AppSyncResolverHandler */  = async (event: any, x: any, a: any) => {
  console.log(event);
  console.log(x);
  console.log(a);

  return {
    statusCode: 200,
    headers: { "Content-Type": "text/plain" },
    body: `Hello, World! Your request was received at ${event.requestContext.time}.`,
  };
};
t
I think you just return the data not the status code etc
There's a good article on this if you want deep typing support
m
thx, will check it out