Search code examples
iosamazon-web-servicesamazon-dynamodbaws-amplify

Amazon Connect many tables to one API with Amplify AWS IOS


I am new to amazon services AWS, and I am trying to create a database for my project (DynamoDB). I have followed the tutorial and have all installed (CLI, Amplify, etc). But when I add a new API it creates only one table and scheme. So my question is, how I can have multiple tables (User, Notifications, Promos, etc) using the same API? Or how I can go about this?

Thanks!


Solution

  • Pretty sure if you have multiple @model annotation in your schema.graphql you will have multiple tables. For example,

    type User @model {
      id: ID!
      name: String!
    }
    
    type Notification @model {
      id: ID!
      content: String!
    }
    
    type Promo @model {
      id: ID!
      content: String!
    }
    

    It will create at least 3 tables, one for each. Why? Because @model. Read https://aws-amplify.github.io/docs/cli/graphql#usage