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.5k
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
1.9k
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
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
2
1.6k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
180
C#/.NETのこれまでのふりかえり
tomokusaba
1
140
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
430
レガシーな Android アプリのリアーキテクチャ戦略
oidy
1
170
/←このスケジュール表に立ち向かう フロントエンド開発戦略 / A front-end development strategy to tackle a single-slash schedule.
nrslib
1
580
Progressive Web Apps für Desktop und Mobile mit Angular (Hands-on)
christianliebel
PRO
0
100
Vue3の一歩踏み込んだパフォーマンスチューニング2024
hal_spidernight
3
2.9k
現場で役立つモデリング 超入門
masuda220
PRO
12
2.6k
AWS IaCの注目アップデート 2024年10月版
konokenj
3
2.1k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
290
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
950
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Teambox: Starting and Learning
jrom
132
8.7k
Designing for humans not robots
tammielis
249
25k
Designing the Hi-DPI Web
ddemaree
280
34k
Happy Clients
brianwarren
97
6.7k
Code Reviewing Like a Champion
maltzj
519
39k
Side Projects
sachag
452
42k
A designer walks into a library…
pauljervisheath
202
24k
Agile that works and the tools we love
rasmusluckow
327
21k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Building Your Own Lightsaber
phodgson
102
6k
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