Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
活用パターンで学ぶGraphQL
Search
Taewoo Kim
June 26, 2020
Programming
0
1.3k
活用パターンで学ぶGraphQL
クラスメソッド年次技術イベント「Developers.IO 2020 CONNECT」 で登壇した内容です。
Taewoo Kim
June 26, 2020
Tweet
Share
More Decks by Taewoo Kim
See All by Taewoo Kim
AWS Lambda 내부동작 파헤치기
twkiiim
1
2.6k
Amazon VPC Deep Dive: ENI 를 알면 VPC 가 보인다
twkiiim
2
5.3k
온라인 주문 서비스를 서버리스 아키텍쳐로 구축하기
twkiiim
0
380
Amplify Meetup #01
twkiiim
1
6.3k
Amazon EventBridge vs Amazon SNS
twkiiim
0
2.1k
AWS 기반 서버리스 아키텍쳐 톺아보기
twkiiim
0
2k
AWS 기반 서버리스 아키텍쳐 톺아보기
twkiiim
1
2.9k
AppSync를 활용한 리얼타임 서버리스 아키텍쳐
twkiiim
0
4.4k
[LINE API × Tech API Vol. 2 Powered by AWS] サーバーレスでの分散トランザクション
twkiiim
0
2.3k
Other Decks in Programming
See All in Programming
as(型アサーション)を書く前にできること
marokanatani
10
2.6k
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
受け取る人から提供する人になるということ
little_rubyist
0
230
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
Click-free releases & the making of a CLI app
oheyadam
2
110
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
Featured
See All Featured
Docker and Python
trallard
40
3.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Writing Fast Ruby
sferik
627
61k
Side Projects
sachag
452
42k
Done Done
chrislema
181
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
KATA
mclloyd
29
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Faster Mobile Websites
deanohume
305
30k
Transcript
5BFXPP,JN ׆༻ύλʔϯͰֶͿ(SBQI2-
ࣗݾհ 5BFXPP,JN ΩϜςʣ "84ࣄۀຊ෦ίϯαϧςΟϯά෦ॴଐ ݄ೖࣾɺຊޠྺ "1/"845PQ&OHJOFFSTʹબ Ϋϥεϝιουͷ࠷ॳͷؖࠃਓΤϯδχΞ ͖ͳ"84αʔϏεɿ"QQ4ZODɺ"NQMJGZ
ηογϣϯ֓ཁ ͜ͷηογϣϯͰ͞ͳ͍͜ͱ (SBQI2-ͷจ๏ (SBQI2-εΩʔϚσβΠϯͷϕετϓϥΫςΟε ίʔυϨϕϧͰͷϕετϓϥΫςΟε (SBQI2-ΛͬͨೝূɾηΩϡϦςΟ (SBQI2-ϞχλϦϯάɾ࠷దԽ
ηογϣϯ֓ཁ ͜ͷηογϣϯͰ͢͜ͱ (SBQI2-ͷొഎܠͱجૅ֓೦ (SBQI2-ΞʔΩςΫνϟʔύλʔϯ #BDLFOE'PS'SPOUFOE 3FBMUJNF"SDIJUFDUVSF 5ISFF'BDUPS"QQ (SBQI2-ͷ$234ύλʔϯ
GraphQLͷ֓೦
(SBQI2-ͷ֓೦ɿొഎܠ REST API Λ։ൃ͢ΔνʔϜͰ ΄ͱΜͲಉ͡ͱઓ͏
(SBQI2-ͷ֓೦ɿొഎܠ ྫ͑ɺҎԼͷ"1*͕͋ͬͨͱ͢Δ (&5BQJVTFST
(SBQI2-ͷ֓೦ɿొഎܠ ϖʔδωʔγϣϯͨΓલ͔ͩΒɺ͜͏ͳΔ (&5BQJVTFST QBHF@OVN
(SBQI2-ͷ֓೦ɿొഎܠ ཁ͕݅૿͑ͯɺϞόΠϧͱΣϒΛಉ࣌ʹαϙʔτ͢Δ ͜ͱʹͳΔ (&5BQJVTFST QBHF@OVNQMBUGPSNNPCJMF (&5BQJVTFST QBHF@OVNQMBUGPSNXFC
(SBQI2-ͷ֓೦ɿొഎܠ ϦΫΤετΛૹΔଆͷը໘ߏʹΑΓɺϨεϙϯεͷσʔ λͷछྨ͕ҟͳΔ (&5BQJVTFST QBHF@OVNQMBUGPSNNPCJMFUZQFQMBZFS@MJTU (&5BQJVTFST QBHF@OVNQMBUGPSNNPCJMFUZQFDIBUUJOH@SPPN (&5BQJVTFST
QBHF@OVNQMBUGPSNXFCUZQFVTFS@NBOBHFS
(SBQI2-ͷ֓೦ɿొഎܠ όοΫΤϯυଆͷAPIؔҰ͚ͭͩͰ ίʔυ͕ඦϥΠϯʹͳΔ ॏෳίʔυ͕ଟ͘ͳͬͯޮ͕Α͘ͳ͍
(SBQI2-ͷ֓೦ɿొഎܠ ϝϯςφϯε͕ݫ͘͠ͳΔ͔Βɺ࠷ॳ͔ΒඞཁͳϑΟʔ ϧυͷΈϦΫΤετ͢Δ (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E OJDLOBNF JNBHF
X@ I@ NPEF (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E OJDLOBNF CJSUI JOUFSFTUT JNBHF X@ I@ NPEF JODMVEFGSJFOE@MJTU
(SBQI2-ͷ֓೦ɿొഎܠ όοΫΤϯυଆͪΐͬͱָʹͳΔ
(SBQI2-ͷ֓೦ɿొഎܠ ͔͠͠ɺΫϥΠΞϯτଆͰඞཁͱ͢Δ ෳࡶͳAPIΛઃܭ͢Δ͜ͱͱ͍ͯ͠ Θ͚͕͔Βͳ͍APIʹͳΔ
(SBQI2-ͷ֓೦ɿొഎܠ ͔͠͠ɺϑϩϯτΤϯυଆͰ APIΛཧղͮ͠Β͘ͳΔ ͏Θ͚͕Θ͔Βͳ͍APIʹͳΔ (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E OJDLOBNF
JNBHF X@ I@ NPEF (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E OJDLOBNF CJSUI JOUFSFTUT JNBHF X@ I@ NPEF JODMVEFGSJFOE@MJTU
(SBQI2-ͷ֓೦ɿ04'"ʢ0OF4J[F'JUT"MMʣ 04'" 0OF4J[F'JUT"MM ݩʑҰͭͷϢʔζέʔεʹ࠷దԽ͞ΕΔΑ͏ʹઃܭ͞Ε͕ͨɺ ͲΜͲΜ"1*͕େ͖͘ͳΓɺଟ͘ͷϢʔζέʔεʹ͑ΔΑ͏ ʹͳͬͯɺϝϯςφϯεՃػೳͷ֦ு͕ݫ͘͠ͳΔ
(SBQI2-ͷ֓೦ɿ5"%" 20159݄ɺFacebook ΑΓ GraphQL ͕ެࣜʹެ։͞Ε·ͨ͠ʂ
(SBQI2-ͷ֓೦ɿTBNQMFSFRSFTQ query { users { accountId name imageUrl
} } { “data”: { “accountId”: “twkiiim”, “name”: “Taewoo Kim”, “imageUrl”: “…..” } } Request Response
(SBQI2-ͷ֓೦ɿλΠϓʢ5ZQFʣ (SBQI2-λΠϓγεςϜ type User { id: ID! accountId:
String! name: String! imageUrl: String address: Address } type Address { zipcode: String! city: String! } type Chatroom { id: ID! users: [User!]! createdAt: DateTime! }
(SBQI2-ͷ֓೦ɿΫΤϦʢ2VFSZ σʔλΛऔಘ͢Δ query { user(id: 13) { accountId
name address { city } } }
(SBQI2-ͷ֓೦ɿϛϡʔςʔγϣϯʢ.VUBUJPO σʔλΛૢ࡞͢Δ σʔλͷੜɾมߋɾআ mutation { createUser(input: { name:
“Taewoo Kim”, zipcode: “000-0000”, city: “Tokyo” }) { id } }
(SBQI2-ͷ֓೦ɿαϒεΫϦϓγϣϯʢ4VCTDSJQUJPO σʔλΛߪಡ͢Δ subscription { onCreateUser { id name
address { zipcode city } } }
(SBQI2-ͷ֓೦ɿ·ͱΊ (SBQI2-ͷࡾͭͷΦϖϨʔγϣϯ ΫΤϦʢ2VFSZʣ ϛϡʔςʔγϣϯʢ.VUBUJPOʣ αϒεΫϦϓγϣϯʢ4VCTDSJQUJPOʣ ͜ͷࡾͭͷΦϖϨʔγϣϯʹΑΓɺ༷ʑͳύλʔϯ͕ߟ ͑ΒΕ·͢ʂ
GraphQLΞʔΩςΫνϟʔύλʔϯ
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE Backend-For-Frontend ύλʔϯ
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE (SBQI2-લͷ΄ͱΜͲͷ"1* αʔόࠨଆͷΑ͏ͳߏ ϓϥοτϑΥʔϜຖʹ༷ʑͳଟ͘ͷ ϢʔζέʔεΛͨͩҰ͚ͭͩͷ"1* αʔόͰશͯॲཧͤ͞Δߏ 04'"ʢ0OF4J[F'JUT"MMʣ͕͋Δ
ͨΊɺن͕େ͖͘ͳΕͳΔ΄Ͳɺޮ ͕ٸܹʹԼ͕Δ
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE ֤ϓϥοτϑΥʔϜʹ߹Θͤͯ"1*αʔόΛ͚Δઓུ ϓϥοτϑΥʔϜຖʹָʹΧελϚΠζͰ͖ΔͷͰྑ͍ʂ ಉ͡ػೳΛߦ͏ίʔυ͕ͦΕͧΕͷ"1*αʔόͷίʔυʹଘࡏ ͢ΔͷͰίʔυͷॏෳ͕ଟ͘ͳͬͨΓ͢ΔͷͨΊɺՃͷ ͕͔͔Δ
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE γϯάϧ(SBQI2-"1*αʔόͰ#''͕Ͱ͖Δʁ ΫϥΠΞϯτଆͰඞཁͳϑΟʔϧυΛબΜͰϦΫΤετΛ ૹΔ͔ΒɺϓϥοτϑΥʔϜຖʹϖΠϩʔυ࠷దԽ͕ࣗવʹຬ ͨ͞ΕΔ
(SBQI2-ύλʔϯɿ#'' #BDLFOE'PS'SPOUFOE ͔͠͠ʂʂ ·ͨ04'"͕ൃੜ͢ΔՄೳੑ͋Δ ϖΠϩʔυɺͭ·Γɺσʔλͷදݱͱ͍͏؍Ͱγϯάϧ(SBQI2- "1*͚ͩͰશવྑ͍͚ͲɺϓϥοτϑΥʔϜຖͷϢʔβೝূɺΩϟογ ϯάΛߟ͑ͯΈΔͱɺΓ"1*αʔό͚ͨํ͕ྑ͍ ҰํɺϖΠϩʔυͷΧελϚΠζͷΈ͕ཁ݅Ͱ͋Εɺγϯάϧ
(SBQI2-"1*Ͱ#''͢Δ͜ͱશવ͋Γ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF Realtime Architecture ύλʔϯ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF ͳͥ(SBQI2-ͱϦΞϧλΠϜΛΈ߹ΘͤΔͷ͔ʁ ϦΞϧλΠϜΞʔΩςΫνϟʔιέοτͰ࣮ग़དྷΔ (SBQI2-Λ͏ͱλΠϓγεςϜͷ͓ӄͰߋʹޮతͳ࣮͕ग़དྷΔ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF αϒεΫϦϓγϣϯʢ4VCTDSJQUJPOʣ (SBQI2-ͷΦϖϨʔγϣϯͰ͋ΔαϒεΫϦϓγϣϯΛ͏ ͜ͱͰ΄ͱΜͲͷϦΞϧλΠϜαʔϏεͷ࣮͕؆୯ʹͳΔ σʔλܗࣜʢλΠϓʣΛఆٛ͢Δ͚ͩͰϦΞϧλΠϜػೳ͕͑Δɿ "QQ4ZODɺ)BTVSBͷΑ͏ͳαʔϏεͷ͓ӄͰόοΫΤϯυଆͷ࣮ ͷͨΊͷखؒΛ͔͚ͣʹϦΞϧλΠϜཁ݅ͷ࣮͕Մೳʹͳͬͨʂ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF https://youtu.be/kuTyxcjqeUk จαʔϏεDEMO
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF ϦΞϧλΠϜػೳͷ ͨΊ"QQ4ZODΛͬ ͨαϯϓϧͷߏ จαʔϏεͷॲཧΠ ϕϯτΛΞυϛϯଆͷ ը໘ʹϦΞϧλΠϜͰ දࣔͯ͘͠ΕΔγφϦ
Φ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF https://youtu.be/ZujdsxSRt48 ྫʣApollo + Hasura
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF "84"QQ4ZOD "84ͷϚωʔδυ(SBQI2-αʔϏεʢαʔόʔϨεʣ εΩʔϚΛఆ͓͚ٛͯͩ͘͠ͰউखʹαϒεΫϦϓγϣϯػೳ͕͑Δ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF AppSync ͷ subscription Λͬͨྫ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF ϒϩάॻ͍ͯ·͢ʂ
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF https://dev.classmethod.jp/articles/serverless-for-order-system-jawsdays2020/
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF https://dev.classmethod.jp/articles/appsync-for-realtime-communication-akiba-aws-15/
(SBQI2-ύλʔϯɿ3FBMUJNF"SDIJUFDUVSF https://dev.classmethod.jp/articles/relay-re-introduction-2019-appsync/
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ Three Factor App ύλʔϯ
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ )BTVSB͞Μ͕ఏҊͨ͠ϞμʔϯϑϧελοΫΞϓϦέʔ γϣϯͷΞʔΩςΫνϟʔ ϦΞϧλΠϜ(SBQI2- ϦϥΠΞϏϦςΟʔͷͨΊͷΠϕϯτॲཧ ඇಉظαʔόʔϨε
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ https://3factor.app/ 1. ϦΞϧλΠϜGraphQL 2. ϦϥΠΞϏϦςΟͷͨΊͷΠϕϯτॲཧ 3. ඇಉظαʔόʔϨε
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ϦΞϧλΠϜ(SBQI2- w ͙͢ϑΟʔυόοΫՄೳ w (SBQI2-ͷαϒεΫϦϓγϣϯʹ࣮ͯ͞ΕΔ
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ϦϥΠΞϏϦςΟʔͷͨΊͷΠϕϯτॲཧ w (SBQI2-ϛϡʔςʔγϣϯͷ͍ॲཧΛͨͣʹɺ؆୯ʹ ॲཧͰ͖ΔΦϖϨʔγϣϯʢΠϕϯτΛੜ͢Δ͜ͱʣΛ ߦ͏ w Πϕϯτগͳ͘ͱճඞͣରαʔϏεʹΘΔ
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ඇಉظαʔόʔϨε w ֤ϚΠΫϩαʔϏεαʔόʔϨεͰ࣮͞Εͯ͋Δ w ֤αʔϏεΠϕϯτετΞ͔ΒΠϕϯτΛड͚͚ͯॲཧ ͢Δ w
ಉ༷ͷΠϕϯτԿճॲཧͯ͠ಉ͡ঢ়ଶʹͳΔΑ͏ʹ࣮ ͢Δʢ*EFNQPUFOUʣ w Πϕϯτͷॱ൪ʹӨڹΛड͚ͳ͍
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ https://3factor.app/ 1. ϦΞϧλΠϜGraphQL 2. ϦϥΠΞϏϦςΟͷͨΊͷΠϕϯτॲཧ 3. ඇಉظαʔόʔϨε
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ https://3factor.app/ 1. ϦΞϧλΠϜGraphQL 2. ϦϥΠΞϏϦςΟͷͨΊͷΠϕϯτॲཧ 3. ඇಉظαʔόʔϨε
$234ύλʔϯͱʁ w $PNNBOE2VFSZ3FTQPOTJCJMJUZ4FHSFHBUJPOͷུޠ w ΫΤϦͱϛϡʔςʔγϣϯΛͯ͠ߟ͑ΔΞϓϩʔν w 5ISFF'BDUPS"QQ(SBQI2-Ͱ$234ύλʔϯΛ ࣮͢ΔͨΊͷํ๏
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ΫΤϦ(SBQI2-ͷॲཧͦͷ··Ͱ0, ϛϡʔςʔγϣϯΠϕϯτΛൃੜ͙ͯ͢͠ϨεϙϯεΛฦ͢
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ϛϡʔςʔγϣϯΑΓΠϕϯτ͕ੜ͞Εͨ߹ɺ Πϕϯτ֘͢ΔαʔϏεʹૹΒΕΔʢΠϕϯτϧʔςΟϯάʣ
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ૹΒΕͨΠϕϯτΠϕϯτετΞʹอଘ͞ΕΔ ˠɹඇಉظͰॲཧ͞ΕΔ
(SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ ඇಉظͰॲཧ͞ΕͨΠϕϯτʢݩͷϛϡʔςʔγϣϯʣʹΑΓɺ αϒεΫϦϓγϣϯ͕τϦΨʔ͞ΕΔ
·ͱΊ
·ͱΊ (SBQI2-ͷొഎܠʹ͍ͭͯઆ໌͠·ͨ͠ (SBQI2-ͷ̏ͭͷΦϖϨʔγϣϯʹ͍ͭͯઆ໌͠·͠ ͨ (SBQI2-ΞʔΩςΫνϟʔΛઃܭ͢ΔࡍʹࢀߟʹͳΕ ΔΞʔΩςΫνϟʔͱߟ͑ํΛհ͠·ͨ͠
None