Posted On: Mar 23, 2022
AWS Amplify announces the new @mapsTo GraphQL directive, enabling developers to iterate and rename their GraphQL models without worrying about data migration. The AWS Amplify CLI is a command line toolchain that helps frontend developers create app backends in the cloud. With Amplify’s GraphQL Transformer, developers can configure their backend data model using the GraphQL Schema Definition Language, and Amplify CLI automatically transforms the schema into a fully functioning GraphQL API with its underlying database tables.
Before today, developers were required to manually export and migrate data when making changes to their GraphQL model names. Customers can now use the @mapsTo directive to rename the client-facing GraphQL model and retain the underlying DynamoDB table data. Amplify CLI, under the hood, will remap the new GraphQL model name to the original underlying DynamoDB tables.
Learn more about how to use Amplify CLI’s new @mapsTo GraphQL directive in the Amplify documentation.