[{"data":1,"prerenderedAt":71},["ShallowReactive",2],{"pattern-appsync-lambda-graphql-cdk":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":13,"deploy":15,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":30,"language":36,"level":37,"meta":38,"patternArch":39,"resources":52,"s3URL":6,"services":64,"stem":65,"testing":66,"videoId":29,"__hash__":70},"patterns\u002Fpatterns\u002Fappsync-lambda-graphql-cdk.json","AWS Lambda to AWS AppSync",null,{"headline":8,"text":9},"Cleanup",[10,11,12],"1. Delete the stack: \u003Ccode>npx cdk destroy\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>.","3. You see a message confirming DELETE_COMPLETE.",[14],"content\u002Fcontributors\u002Fbrice-pelle.json",{"text":16},[17],"cdk deploy","Create a Lambda function that triggers an AppSync GraphQL API.","json","AWS CDK",{"template":22,"payloads":27},{"projectFolder":23,"repoURL":24,"templateURL":25,"templateFile":26},"cdk-lambda-appsync","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Fcdk-lambda-appsync","serverless-patterns\u002Fcdk-lambda-appsync","cdk\u002Flib\u002Fmain.ts",[28],{"headline":29,"payloadURL":29},"",{"headline":31,"text":32},"How it works",[33,34,35],"In this pattern, AWS AppSync provides a a schema that allows you to manage and read todos. A Lambda function is implemented that can interact with the GraphQL API.","This function can create todos by using the codegen generated from the schema by the Amplify CLI codegen. The codegen provides the operations and the variable types, which makes it simple to interact with the AppSync GraphQL API from the Typescript function.","This pattern is useful in event driven design that trigger your AppSync function from the backend. Those changes can they easily be reflected on front-end clients in real time by using AppSync subscriptions.","Node.js","200",{},{"icon1":40,"icon2":45,"line1":49},{"x":41,"y":42,"service":43,"label":44},20,50,"lambda","AWS Lambda",{"x":46,"y":42,"service":47,"label":48},80,"appsync","AWS AppSync GraphQL API",{"from":50,"to":51,"label":29},"icon1","icon2",{"headline":53,"bullets":54},"Additional resources",[55,58,61],{"text":56,"link":57},"Exporting AppSync operations to a Lambda layer for easy reuse","https:\u002F\u002Fdocs.amplify.aws\u002Fguides\u002Ffunctions\u002Fappsync-operations-to-lambda-layer\u002Fq\u002Fplatform\u002Fjs\u002F",{"text":59,"link":60},"Simplify access to multiple microservices with AWS AppSync and AWS Amplify","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fmobile\u002Fappsync-microservices\u002F",{"text":62,"link":63},"Tutorial: HTTP Resolvers","https:\u002F\u002Fdocs.aws.amazon.com\u002Fappsync\u002Flatest\u002Fdevguide\u002Ftutorial-http-resolvers.html",{"from":43,"to":47},"patterns\u002Fappsync-lambda-graphql-cdk",{"headline":67,"text":68},"Testing",[69],"See the GitHub repo for detailed testing instructions.","7CrZX_QhMxdEhI_jvNR-ww7xdazIXaICPa9H3vyF5JM",1781606111579]