Amplify

  • A managed serverless backend that is a layer onto of AppSync(Managed GraphQL API) and Lambda functions

amplify push --iterative-rollback #to rollback the last-known-good state
amplify push --force #rollback the last-known-good state and try redeploying your changes again using.

Modeling

Primitatives: ID | String | Int | Float | Boolean |

AWS Types: AWSDate | AWSTime | AWSDateTime | AWSTimestamp | AWSEmail | AWSJSON | AWSPhone | AWSURL | AWSIPAddress

type Post @model {
  id: ID!
  title: String!
  comments: [Comment] @hasMany
}

type Comment @model {
  id: ID!
  content: String!
}

Advanced Modeling

Adding Indexes

  • The primary key of an index must use equality, the secondary/sort key can use gt, ge, lt, le, eq, beginsWith, and between

  • Can have multiple sort keys and will created composite key, so you can query by more then three values

    • May need to backfill composite key

  • @index is basically @key v2 and is used to define secondary index, while @primaryKey is for primary keys

Will error out if the index primary or secondary key does not exist

Using Javascript

Last updated