AWS's managed [[GraphQL]] service. ## Common tasks and questions - [[Should I use a VTL template or Lambda function for an AppSync resolver]]? - [[How to paginate lists returned from DynamoDB through an API endpoint]] - [[How does AppSync OpenID authentication work]] - [[Load testing an AppSync API with Artillery]] - [[How to create alarms for AppSync resolver field errors]] ## #OpenQuestions - Is there a limit on the amount of subscriptions (over websockets) from clients to AppSync at any one time? - A: Seems pretty high. From [this](https://aws.amazon.com/blogs/mobile/appsync-realtime/), "In one of our tests we managed to effortlessly reach 10 million active WebSocket connections on AppSync with plenty of room to scale to much more" - How to test VTL and GraphQL schemas locally without needing to deploy every time - Potential solution from [[Rich Buggy]]: https://twitter.com/richbuggy/status/1304049966025908224 - How to generate a Typescript client off AppSync's GraphQL schema. Started trying [GraphQLCodeGenerator](https://graphql-code-generator.com), but it wasn't recognised types such as AWSEmail. - From a codebase design POV, now that my data access logic lives inside VTL templates, what if I need to make data access calls from inside a Lambda function or some other Node.js runtime environment (say inside a Jest test)? AFAIK, I can't re-use these templates. Main concern here is around logic for generating compound index keys, especially during updates. - Is there a way to make a create/update to a [[DynamoDB]] table and then put an [[AWS EventBridge]] event within the same GraphQL mutation request (e.g. using a pipeline resolver), without having to use a Lambda function? If so, this would somewhat mitigate previous concern around VTL re-use. - ~~Is it possible to download a GraphQL schema from an endpoint without providing an authentication token? (e.g. for use in a GraphiQL style UI). Understandable that you need a token to make an actual request, but just to access the schema?~~ SOLUTION: Enable APIKey as a secondary auth mechanism. - Does GraphQL schema documentation syntax (three double quotes) work in AppSync? AWS console or GraphQL Playground doesn't seem to pull it in, although type descriptions for types such as AWSEmail are pulled through. AWS Console schema editor doesn't allow it to be typed in. - How to pass environment configuration variables into VTLs (e.g. Event bus name or URL for HTTP data source) - How to quickly find the [[AWS CloudWatch|CloudWatch]] log stream for my mutation/query ## Learning resources - [**AppSync Masterclass**](https://theburningmonk.thinkific.com/courses/appsync-masterclass-premium?ref=89352c), by Yan Cui. An in-depth video course covering full-stack development of a Twitter clone using AppSync, Lambda, DynamoDB and the Serverless Framework. Use the following links (disclosure: affiliates) for purchasing specific packages: - [AppSync Masterclass premium](https://theburningmonk.thinkific.com/courses/appsync-masterclass-premium?ref=89352c) - [AppSync Masterclass plus](https://theburningmonk.thinkific.com/courses/appsync-masterclass-plus?ref=89352c) - [AppSync Masterclass basic](https://theburningmonk.thinkific.com/courses/appsync-masterclass-basic?ref=89352c)