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
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
103 Early Hints
sugi_0000
1
230
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
410
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
1k
Recoilを剥がしている話
kirik
5
6.6k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
Beyond ORM
77web
3
380
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
命名をリントする
chiroruxx
1
390
testcontainers のススメ
sgash708
1
120
Featured
See All Featured
It's Worth the Effort
3n
183
28k
Documentation Writing (for coders)
carmenintech
66
4.5k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Site-Speed That Sticks
csswizardry
2
190
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Become a Pro
speakerdeck
PRO
26
5k
Docker and Python
trallard
42
3.1k
The Pragmatic Product Professional
lauravandoore
32
6.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
Visualization
eitanlees
146
15k
We Have a Design System, Now What?
morganepeng
51
7.3k
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