Posted On: Dec 13, 2023
AWS Amplify now supports using existing MySQL and PostgreSQL databases for GraphQL APIs created with Amplify’s Cloud Development Kit (CDK) construct, enabling you to create a backend-for-frontend API layer for web and mobile apps with ease. Developers often have data spread across various databases and sources. With Amplify's new feature, you can now leverage your existing relational data for GraphQL APIs in addition to Amazon DynamoDB.
Creating a new GraphQL API for existing MySQL and PostgreSQL data sources can be a manual and tedious process, requiring developers to hand-author the API logic, configure networking settings between the API and database layer, and spend hours reflecting changes to the database schema back to the API. The Amplify workflow only takes three steps. First, provide your database endpoint to let Amplify generate a GraphQL API with CRUD operations and, optionally, configure necessary VPC settings. Second, enhance the GraphQL API using “directives” to configure additional authorization rules (“@auth”) and relational queries (“@hasOne”, “@hasMany”). Finally, as your use cases evolves, Amplify allows you to create custom queries and mutations using a new “@sql” directive.
To get started, check out our blog post or review our documentation.