Slide 1

Slide 1 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE .FHVSPEFWNFHVSP@EFW "NQMJGZה"QQ4ZODה*P5#VUUPOד⡲׏׋ ٔ،ٕة؎ي䫎牰ءأذي

Slide 2

Slide 2 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE 㝩歊 剼䒽אַ׌ ֹ֮מ׹ • أة٦ز،حفأُ٦ءّٝ鿇 ءص،أُ٦ءّٝ،٦ؗذؙز • TUBSUVQGJOUFDIGJOUFDITFDVSJUZ CMPDLDIBJOTFSWFSMFTTNPCJMF EFWFMPQNFOU✳⯢ך显

Slide 3

Slide 3 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE 4UBSUVQ"SDIJUFDUVSFPGUIFZFBS דך䫎牰ءأذي׾⡲׏׋鑧

Slide 4

Slide 4 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE

Slide 5

Slide 5 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 4UBSUVQ"SDIJUFDUVSFPGUIFZFBS ! # CTO100 Architecture of the year AWS " " # 7 ! ! !

Slide 6

Slide 6 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. ؔ٦ر؍ؒٝأ 颣 • 굲㣓⠓㜥ך㾜爙ـ٦أחג♧菙勻㜥罏ח״׷نةٝ䫎牰 ָ遤׻׸גְתׅ

Slide 7

Slide 7 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE 䔲傈ך圫㶨כ׈מֿ׍׵ךش؎أٖه٦ز׾ https://codezine.jp/article/detail/10880

Slide 8

Slide 8 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE ؔ٦ر؍ؒٝأ颣䫎牰ءأذيرٌ

Slide 9

Slide 9 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE

Slide 10

Slide 10 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE 䫎牰ءأذيך酅⩎

Slide 11

Slide 11 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE 䫎牰ءأذيך圓䧭 -BNCEB GVODUJPO Finalist.1 Button Finalist.2 Button Finalist.n Button ... "84 "QQ4ZOD %ZOBNP %# "84 "NQMJGZ 44UBUJD 8FCTJUF)PTUJOH Invoke subscribe Query Static contents chart.js PutItem mutation push

Slide 12

Slide 12 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE "QQ4ZODך4DIFNB饔㶵ָNVUBUJPO鿇ⴓ type Mutation { updateVoteCount(input: UpdateVoteInput!): VoteCount } input UpdateVoteInput { Finalist: String! } type AllVotes { votes: [VoteCount!] } input CreateVoteHistoryInput { Finalist: String! } type Query { getVoteCount(Finalist: String!): VoteCount getAllVotes: AllVotes } type Subscription { newVote: VoteCount @aws_subscribe(mutations:["updateVoteCount"]) } type VoteCount { Finalist: String! Votes: Int }

Slide 13

Slide 13 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE -BNCEBַ׵ךNVUBUJPO const gql = require('graphql-tag'); // Set up mutation const newVote = gql(` mutation NewVote { updateVoteCount(input: {Finalist: "${Finalist}"}){ Finalist, Votes } } `); // Set up Apollo client const client = new AWSAppSyncClient({ url: url, region: region, auth: { type: type, credentials: AWS.config.credentials, }, disableOffline: true }); try { const newVoteResult = await client.mutate({ variables: { type: "variables", }, mutation: newVote, }); callback(null, { newVoteResult: newVoteResult, }); } catch (err) { callback(err); }

Slide 14

Slide 14 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE "NQMJGZַ׵ךTVCTDSJQUJPO // src/Queries/SubscribeToNewVote.js import gql from 'graphql-tag'; export default gql` subscription newVote { newVote { __typename Finalist Votes } }`; // src/Components/AllVotes.js import SubscribeToNewVote from '../Queries/SubscribeToNewVote'; componentDidMount() { this.props.allVotesQuery.subscribeToMore({ document: SubscribeToNewVote, updateQuery: (prev, { subscriptionData }) => { let newVote = subscriptionData.data.newVote; this.updateChart( newVote.Finalist, newVote.Votes ); } }); } (...snip...)

Slide 15

Slide 15 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE *P5نةٝחאְג • ぐ *P5&OUFSQSJTFنةٝחכչ1MBDFNFOUպ׾ⶴ׶䔲ג׷ • 1MBDFNFOUךنةٝ׾䬃ׇל\GJOBMJTFUGJOBMJTU^ 1MBDFNFOUךنةٝ׾䬃ׇל\GJOBMJTFUGJOBMJTU^ 1MBDFNFOUךنةٝ׾䬃ׇל\GJOBMJTFUGJOBMJTU^ • ֿ׸׵ָ -BNCEBؿ؋ؙٝءّٝךFWFOUػًٓ٦ةח 床׏גֻ׷ • ̔ ؿ؋ؙٝءّٝⰻדNVUBUJPOךػًٓ٦ةח • 鿪䏝8J'Jאַ׭זְה鷏⥋㣟侁ׅ׷㉏겗 • 䚈鼓ⴽך8J'J׾欽䠐׃׋׶˘

Slide 16

Slide 16 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE عو׶וֿ׹הַ䠬䟝הַ

Slide 17

Slide 17 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE عو׶וֿ׹כ暴חזַ׏׋ ֽו侒ִג鎉ִל (SBQI2-ךأؗ٦و㹀纏ה 3FBDUⰻדך"QQ4ZOD"QPMMPךسًُؗٝز 然钠ח㼰׃儗꟦׾⢪׏׋կ 䩛鯪ח馄أ؛٦ٓـٕ4$'"NQMJGZ "QQ4ZOD %ZOBNP%# -BNCEBז،فٔ؛٦ ءّٝאֻ׸׋

Slide 18

Slide 18 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE !BLJUTVLBEBתד䠬䟝׾ֶ㺔ׇֻ׌ְׁ

Slide 19

Slide 19 text

h "NB[PO8FC4FSWJDFT *ODPSJUT"GGJMJBUFT"MMSJHIUTSFTFSWFE