Maintained with ☕️ by
IcePanel logo

Connect GraphQL APIs to existing MySQL and PostgreSQL databases with AWS Amplify

Share

Services

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](https://aws.amazon.com/blogs/aws/new-for-aws-amplify-query-mysql-and-postgresql-database-for-aws-cdk/) or review [our documentation](https://docs.amplify.aws/react/build-a-backend/graphqlapi/connect-api-to-existing-database/#auto-generate-crudl-operations-for-existing-tables).