Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AppSync 使ってみた! サーバレスライブコマースの構築

Kazuki Miura
November 04, 2020

AppSync 使ってみた! サーバレスライブコマースの構築

#serverlessjp

Kazuki Miura

November 04, 2020
Tweet

More Decks by Kazuki Miura

Other Decks in Technology

Transcript

  1. query { id : 'aircaravan' } type Query { singlePost(id:

    ID!): Post } { "data": { "singlePost": { "id": "aircaravan", "timeSaleFlg": 1 } } } { "id": "aircaravan", "timeSaleFlg": 1 } AppSync Amplify DynamoDB
  2. mutation {   timeSaleFlg: 1 } type Mutation { putPost(id:

    ID, timeSaleFlg: Int!): Post } { id: "aircaravan", timeSaleFlg: event.arguments.timeSaleFlg } Item: { id: "aircaravan", timeSaleFlg: event.arguments.timeSaleFlg } { "data": { "singlePost": { "id": "aircaravan", "timeSaleFlg": 1 } } } console AppSync Lambda DynamoDB query用にDynamoDBに保存
  3. console AppSync Amplify subscription {   timeSaleFlg: 1 } type

    Subscription { onPutPost: Post @aws_subscribe(mutations: ["putPost"]) } WebSocket type Mutation { putPost(id: ID, timeSaleFlg: Int!): Post } { "data": { "onPutPost": { "id": "aircaravan", "timeSaleFlg": 1 } } }
  4. subscription AppSync AppSync Amplify {   timeSaleFlg: 0 } {

      timeSaleFlg: 1 } shopify GraphQL 商品の入れ替えもGraphQL <v-if="timeSaleFlg"> 非表示 表示
  5. not yet... H O W D O Y O U

    L I K E W E D N E S D A Y ?
  6. TO BE CONTINUED... H O W D O Y O

    U L I K E W E D N E S D A Y ?