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 を活用したスキーマ駆動開発の実践 / schema-driven develo...
Search
qsona
September 08, 2021
Technology
6
5k
GraphQL を活用したスキーマ駆動開発の実践 / schema-driven development with GraphQL
MIDAS TECH STUDY #2
qsona
September 08, 2021
Tweet
Share
More Decks by qsona
See All by qsona
サーバー間 GraphQL と webmock-graphql の話 / server-to-server graphql and webmock-graphql
qsona
4
340
Backend エンジニア視点からの GraphQL / GraphQL from a perspective of backend engineer
qsona
28
8k
3 Practices about Service-to-Service GraphQL Ruby Client
qsona
1
820
いかにして GraphQL を組織に導入するか (新規開発編) / how we introduce GraphQL on scratch development
qsona
6
3.9k
Well-organized Transaction Script - リファクタリングの妥協的手法 -
qsona
4
1.3k
GraphQL と Prisma から考える次のN年を見据えた技術選定 / Architecture decision for the next N years at StudySapuri
qsona
25
13k
最高のマスターデータ管理手法考察 & VSCode Extension を活用した話 / developing masterdata management tool by using vscode extension
qsona
9
6.1k
GraphQL を利用したアーキテクチャの勘所 / Architecture practices with GraphQL
qsona
37
15k
純粋培養GraphQL / Pure GraphQL Architecture
qsona
9
3k
Other Decks in Technology
See All in Technology
Sidekiq vs Solid Queue
willnet
11
7.1k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
49k
生成AIとAWS CDKで実現! 自社ブログレビューの効率化
ymae
2
200
Amazon FSx for NetApp ONTAPを利用するにあたっての要件整理と設計のポイント
non97
1
130
Comparing Apache Flink and Spark for Modern Stream Data Processing
sharonx
0
190
インシデント対応の 実践と品質文化の醸成
____rina____
2
1.5k
新卒1年目が挑む!生成AI × マルチエージェントで実現する次世代オンボーディング / operation-ai-onboarding
cyberagentdevelopers
PRO
0
110
顧客が本当に必要だったもの - パフォーマンス改善編 / Make what is needed
soudai
21
6k
リファクタリングへの耐性が高いモデルベースの統合テストの紹介 / Model-Base Integration Test for Refactoring
yuitosato
5
1.5k
LeSSに潜む「隠れWF病」とその処方箋
lycorptech_jp
PRO
2
110
Capybara+生成AIでどこまで本当に自然言語のテストを書けるか?
yusukeiwaki
6
1.3k
pandasはPolarsに性能面で追いつき追い越せるのか
vaaaaanquish
3
1.4k
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Side Projects
sachag
452
42k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
280
How to Ace a Technical Interview
jacobian
275
23k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
780
Music & Morning Musume
bryan
46
6.1k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
32
1.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Cult of Friendly URLs
andyhume
78
6k
Transcript
GraphQL Λ׆༻ͨ͠ εΩʔϚۦಈ։ൃͷ࣮ફ @qsona 2021-09-08 MIDAS TECH STUDY #2
whoami • @qsona • Web Engineer at Quipper Ltd •
Microservices / Rails / Node.js / GraphQL
ࠓճͷςʔϚ: ϑϩϯτΤϯυ։ൃޮԽ
։ൃʹ͓͚ΔʮޮԽʯͱ?
Ϧιʔεޮͱϑϩʔޮ • ΞδϟΠϧ։ൃͷจ຺ͰΑ͘ొ͢Δ֓೦ • ʮޮʯ(Efficiency) Λೋͭͷଆ໘͔Βఆ͍ٛͯ͠Δ
Ϧιʔεޮ γεςϜ։ൃͷจ຺ʹ͓͍ͯɺେࡶʹ͍͏ͱ: • ਓతϦιʔεͷྔ (ਓɾ) ʹରͯ͠ɺੜΈग़ͤΔػೳͷྔ • Ϧιʔεޮ͕ѱ͍ྫ • ϑϩϯτΤϯυͷ։ൃ͕։࢝Ͱ͖Δͷɺ
όοΫΤϯυͷ։ൃ͕ऴΘ͔ͬͯΒ => όοΫΤϯυͷ։ൃྃ·ͰɺϑϩϯτΤϯδχΞ͕Ջ͍ͯ͠Δ
ϑϩʔޮ γεςϜ։ൃͷจ຺ʹ͓͍ͯɺେࡶʹ͍͏ͱ: • Ϣʔβʔʹػೳ͕ϦϦʔε͞ΕΔ·Ͱͷɺ࣌ؒͷ͞ • ϦϦʔε͞Εͳ͍ͱՁʹͳΒͳ͍ɻ ՁʹͳΔ·Ͱͷ͕͍ͪ࣌ؒͱޮ͕ѱ͍ɺͱ͍͏ߟ͑ํ • ϑϩʔޮ͕ѱ͍ྫ •
ػೳͷ͏ͪόοΫΤϯυͷ։ൃ͕ͨ͠ɺϑϩϯτΤϯυͷ։ൃ͕·ͩɻ όοΫΤϯυࢹͰϦϦʔεͪͷঢ়ଶ͕͘ଓ͍͍ͯΔ
εΩʔϚۦಈ։ൃͱ ։ൃޮ
લఏɾԾఆ • ࠷ۙͷΞϓϦέʔγϣϯ։ൃ͍͠ શһ͕ͯ͢ͷྖҬΛ͜ͳ͢ͷࠔ • େ͖͘ϑϩϯτΤϯυɾόοΫΤϯυͰ εΩϧηοτ͕͔ΕΔʹ͋Δ • ࠓճ όοΫΤϯυνʔϜ
ͱ ϑϩϯτΤϯυνʔϜ ͕ଘࡏ͢Δঢ়گΛԾఆ͢Δ
ґଘ͕ؔ͋Δ • ґଘؔ ϑϩϯτΤϯυ => όοΫΤϯυ • όοΫΤϯυ͕ఏڙ͢Δ API Λ
ϑϩϯτΤϯυ͕ར༻͢Δ • ૉʹߟ͑ΔͱɺόοΫΤϯυ => ϑϩϯτΤϯυͷॱͰ։ൃ ͢Δ͜ͱʹͳΔ => ޮ͕ѱ͍ (࣍ϖʔδ͔Βઆ໌)
(1) ϑϩʔޮ͕ѱ͍ • όοΫΤϯυͰ࣮͞Εͨػೳ͕ɺ σϓϩΠ͞ΕΔ·Ͱʹ ͕ͪ࣌ؒͰ͖Δ
(2) Ϧιʔεޮ͕ѱ͍ • ϑϩϯτΤϯδχΞ͕࣮ͪͷؒɺՋʹͳͬͯ͠·͏
(2) Ϧιʔεޮ͕ѱ͍ • ෳͷػೳΛॱʹճ͢͜ͱͰվળՄೳ • ͕ɺݱ࣮ʹ͜Μͳʹ៉ྷʹ͍͔ͳ͍ • όοΫΤϯυͷ࣮͕গ͠ͰΕΔͱɺϑϩϯτΤϯυͷՋ͕ൃੜͯ͠͠·͏
ͦ͜Ͱ εΩʔϚۦಈ։ൃ
εΩʔϚۦಈ։ൃ • ͡Ίʹ API ͷεΩʔϚΛఆΊɺ ϑϩϯτΤϯυ - όοΫΤϯυ ؒͰ߹ҙ͢Δ •
ϑϩϯτΤϯυɺόοΫΤϯυͷ API ͷ࣮Λͨͣʹ API εΩʔϚΛར༻࣮ͯ͠։࢝͢Δ • ΫϥΠΞϯτ্Ͱͷ੩తܕɺϞοΫαʔόʔͳͲ͕ಘΒΕɺ ͋Δఔෆ߹ͳ͘։ൃͰ͖Δ
εΩʔϚۦಈ։ൃͱ։ൃޮ • (1) ϑϩʔޮͷد༩ • (2) Ϧιʔεޮͷد༩
(1) ϑϩʔޮͷد༩ • όοΫΤϯυͱϑϩϯτΤϯυ͕ฒྻͰ։ൃͰ͖ΔͷͰɺ ϑϩϯτΤϯυͷͪ࣌ؒΛͳͤ͘Δ
(2) Ϧιʔεޮͷد༩ • όοΫΤϯυͱϑϩϯτΤϯυͷ։ൃͷґଘؔΛͳͤ͘ΔͷͰɺ ͦΕͧΕͷ։ൃͷॱং͕ࣗ༝ʹͳΔ • ݁Ռͱͯ͠ɺϦιʔεޮΛ͍ٻΊΔ͜ͱ͕ՄೳʹͳΔ
ελσΟαϓϦʹ͓͚Δ GraphQLɾεΩʔϚۦಈ։ൃͷ ࣮ફࣄྫ
None
৽ن։ൃϓϩδΣΫτʹ͍ͭͯ • ։ൃ͢Δͷ • iOS / Android / PC Web
Apps • Backend APIs • ίϯςϯπΛཧ͢ΔγεςϜ • ։ൃظؒ: > 1 • ։ൃऀͷਓ: > 10ਓ
৽ن։ൃʹ GraphQL Λશ໘࠾༻ • client => gateway => backends શମͰ
GraphQL Λ࠾༻ • gateway schema stitching Λར༻͍ͯ͠Δ • ͦͷଞར༻ٕज़ • Ruby on Rails • Node.js + TypeScript + Apollo Server + Prisma 2 • React, Apollo Client
εΩʔϚۦಈ։ൃͷԸܙ • ίϛϡχέʔγϣϯͷϩε͕গͳ͘ɺ ҆ఆͯ͠։ൃΛਐΊΒΕͨ • ϦιʔεޮΛٻΊɺ backend / frontend ͦΕͧΕ
~9ϲ݄ؒ ಠཱͯ͠։ൃͨ͠ • ܨ͗͜ΈεϜʔζ • 1िؒͰશ෦ܨ͗͜Έྃͨ͠
εΩʔϚۦಈ։ൃʹ GraphQL Λར༻͢ΔϝϦοτ • εΩʔϚͱ࣮͕ဃ͍͢͠ͱɺܨ͗͜Έ࣌ʹൃ֮͢Δ͕૿͑ɺ࣌ؒ ͕͔͔Δ (=ޮ͕Լ͕Δ) • GraphQL Λར༻͢ΔͱɺαʔόʔɾΫϥΠΞϯτํͰ
εΩʔϚͱ࣮ͷဃ͕ى͖ʹ͍͘ • αʔόʔ: εΩʔϚΛຬͨ͞ͳ͍ϨεϙϯεΛฦͦ͏ͱ͢ΔͱΤϥʔʹͳΔ • ΫϥΠΞϯτ: ੩తܕΛࣗಈੜ͠ɺར༻Ͱ͖Δ
ฐνʔϜʹ͓͚Δ GraphQL εΩʔϚۦಈ։ൃͷϑϩʔ • εΩʔϚ࠷ऴతʹ GraphQL Gateway ʹఆٛ͞ΕΔɻ ͜Ε֤ Backend
Service ʹఆٛ͞Εͨͷ͕ू͞Ε͍ͯΔ • ϑϩϯτΤϯυओಋͰεΩʔϚΛॻ͘ͱ͖ Ұ୴ GraphQL Gateway αʔϏεʹॻ͘ • ϞοΫαʔόʔͱͯ͠ఏڙͰ͖Δ • ࣮࣌ʹɺεΩʔϚఆٛΛ֤όοΫΤϯυαʔϏεʹҠಈ͢Δ • ※ ͜ͷ෦Ͱͪΐͬͱͨ͠Έ͋Γ (ӈͷπΠʔτ)
Q. ୭͕εΩʔϚΛॻ͖͔͘? • A. ͦͷػೳͷಛੑʹΑΔ • ࠷ऴతʹ߹ҙͰ͖ΕΑ͍ɻ୭͕ॻ͍ͯΑ͍ • ϑϩϯτΤϯυΤϯδχΞϓϩμΫτϚωʔδϟʔ͕εΩʔϚΛॻ͚Δͱɺ ϑϩʔޮԽʹͭͳ͕Δ
• ։ൃͷग़ൃͰ͋Δʮཁٻʯʹ͍ۙ • όοΫΤϯυ࣮͕͍͠ػೳɺόοΫΤϯυΤϯδχΞ͕ఆٛͨ͠΄͏͕ྑ͍ • ࣮Ͱ͖ͳ͍εΩʔϚʹҙຯ͕ͳ͍ͨΊ
Q. ୭͕εΩʔϚΛॻ͖͔͘? • εΩʔϚઃܭʹίπ͕͋Γɺ୭͕ॻ͘ʹͯ͠ମಘ͢Δඞཁ͕͋Δ • ը໘༷ͱDBઃܭͷؒʹ͋ΔʮϦιʔεʯΛ͏·͘ଊ͑Δ • GraphQL ͷ߹ͦΕΛ GraphQL
Type ͱͯ͠දݱ͢Δ • ͭ·ΓɺϑϩϯτΤϯυΤϯδχΞͰ͋ΕDBઃܭΛΠϝʔδ͠ɺ όοΫΤϯυΤϯδχΞͰ͋Εը໘࣮ΛΠϝʔδͰ͖Δͱ͏·͘ ͍͖͍͢
·ͱΊ • εΩʔϚۦಈ։ൃΛ࣮ફ͢Δ͜ͱͰɺ Ϧιʔεޮ·ͨϑϩʔޮΛߴΊΔ͜ͱ͕Ͱ͖Δ • GraphQL Λར༻͢Δͱɺͭͳ͗͜Έͷਫ਼ඇৗʹߴ͍ • εΩʔϚ୭͕ॻ͍ͯΑ͍ɻ ରػೳͷಛੑɺνʔϜͷঢ়گͳͲʹΑͬͯม͑ΔͱΑ͍
We're hiring! • GraphQL, Microservices ͪΖΜ ϑϩϯτΤϯυ͔ΒόοΫΤϯυ·Ͱ ͍ٕज़ʹ৮ΕΒΕΔػձ͋Γ • ·ͣΧδϡΞϧ໘ஊ͔Βɺͥͻ͝Ԡื͍ͩ͘͞
😁