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
iOS × GraphQLの嬉しみとツラミ / Pros and cons of iOS an...
Search
mogaming
September 01, 2018
Technology
4
14k
iOS × GraphQLの嬉しみとツラミ / Pros and cons of iOS and GraphQL
iOSDC2018の発表資料です。誤っていた部分を修正して再UPしました。
mogaming
September 01, 2018
Tweet
Share
More Decks by mogaming
See All by mogaming
Android Instant App 事例調査 / Android Instant App Stories
mogaming
0
460
FirebaseでつくるiOSアプリ/make iOS App with Firebase
mogaming
6
3.5k
Firebaseでつくるグループチェックリスト管理サービス / check list apps on firebase
mogaming
5
540
iOSアプリ開発におけるデバイス選択 / Appropriate choise of supporting devices on iOS app development
mogaming
1
1.1k
デザインに込められたエモを知りたい/Emotion in Service Design
mogaming
1
8.1k
Other Decks in Technology
See All in Technology
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
13
3.6k
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
110
watsonx.ai Dojo #5 ファインチューニングとInstructLAB
oniak3ibm
PRO
0
160
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
社内イベント管理システムを1週間でAKSからACAに移行した話し
shingo_kawahara
0
180
Wantedly での Datadog 活用事例
bgpat
1
430
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
Jetpack Composeで始めるServer Cache State
ogaclejapan
2
170
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Statistics for Hackers
jakevdp
796
220k
How GitHub (no longer) Works
holman
311
140k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
The Language of Interfaces
destraynor
154
24k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Documentation Writing (for coders)
carmenintech
66
4.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
How STYLIGHT went responsive
nonsquared
95
5.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Transcript
J04ʷ(SBQI2-ͷخ͠Έͱπϥϛ J04%$ !@NPHBNJOH
w 5XJUUFS!@NPHBNJOH w %F/"ͰখઆܥαʔϏεͷ։ൃ୲ J04"OESPJE"QQ w #''"1*ͷ։ൃ͍ͯ͠·͢
"CPVU.F
(SBQI2-"1*ΫϥΠΞϯτฤ (SBQI2-"1*αʔόʔฤ (SBQI2-"1*J04͔Βୟ͘ฤ (SBQI2-ͷخ͠Έͱπϥϛ #''Λ׆༻ͯ͠πϥϛʹཱ͔ͪͬͯΈͨ
ࠓ͢͜ͱ
w "1*αʔόʔʹऔΓೖΕΔ͜ͱͷͰ͖ΔΫΤϦݴޠ 'BDFCPPL࡞IUUQTHSBQIRMPSH w 3&45GVMH31$ͱશ͘ҧ͏ࢥͰͰ͖͍ͯΔ 3&45GVM"1*㱻(SBQI2-"1*㱻H31$ w 42-ϥΠΫʹ"1*ʹ͍߹ΘͤͯσʔλΛऔಘ͢Δ
(SBQI2-ͱ
ૣ(SBQI2-"1*Λୟ͍ͯΈΑ͏ʂ ࠓ͔Β(JUIVCͷ(SBQI2-"1*Λࡐʹͯ͠ ࣮ࡍʹ"1*Λୟ͘Λ͍͖ͯ͠·͢ IUUQTEFWFMPQFSHJUIVCDPNWFYQMPSFS
ͱʜͦͷલʹ গ͚ͩ͠ݴ༿ͷઆ໌"
w 2VFSZ 3&45Ͱ͍͏ͱ(&5 w .VUBUJPO3&45Ͱ͍͏ͱ1045 165 %&-&5& ϦΫΤετͷछྨ
(SBQI2-ͷಛ2VFSZʹूத͍ͯ͠ΔͨΊ2VFSZͷΛ͠·͢
ૣ(SBQI2-"1*Λୟ͍ͯΈΑ͏ʂ ࠓ͔Β(JUIVCͷ(SBQI2-"1*Λࡐʹͯ͠ ࣮ࡍʹ"1*Λୟ͘Λ͍͖ͯ͠·͢ IUUQTEFWFMPQFSHJUIVCDPNWFYQMPSFS
։͍ͯΈΔͱ͜Μͳײ͡ ͳΜ͔ΤσΟλΈ͍ͨͳͷ͕։͘ʜφχίϨʁ
w (SBQIJ2-ϒϥβͰݟΕΔ(SBQI2-*%& w ܕ2VFSZ.VUBUJPO͕ҰཡͰ͖Δ w 2VFSZ.VUBUJPOΛॻ͍࣮ͯߦͰ͖Δ w ೖྗิ͕ޮ͘ w ಋೖͱͬͯ؆୯
(SBQIJ2-ʢ͙Β;͌͘Δʁ͙Β;͔͌Δʁʣ IUUQTHJUIVCDPNHSBQIRMHSBQIJRM
(SBQIJ2-ͷ͍ํ ͜͜ʹॻ͘ 36/ ͜͜ʹ݁Ռ͕ग़Δ %PDVNFOU͕ݟΕΔ KTPOͰมఆٛ
࣮ࡍʹऔಘͯ͠ΈΑ͏ʂ 6TFSͷใΛऔಘ 2VFSZ ͯ͠ΈΔ
%PDVNFOU͔Β6TFSΛऔಘ͢Δ2VFSZΛ୳͢ ͜͜Λԡ͢
VTFSΛऔಘͯ͠ΈΔ 2VFSZΛબ 2VFSZҰཡ VTFSΛݕࡧ
VTFSΛऔಘͯ͠ΈΔ VTFSRVFSZͷઆ໌ 6TFS5ZQF͔ΒऔΕΔ'JFMET ฦ͞ΕΔܕ 2VFSZͷҾ ͜ΕΛऔͬͯΈΔ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ ϥΠϒϥϦʹΑ࣮ͬͯ͞Ε͍ͯͳ͜ͱ͋Δ (SBQI2-"1*ͷಛ
VTFSΛऔಘͯ͠ΈΔ 4&-&$5CJP'30.VTFS 8)&3&MPHJObNPHBNJOH` Έ͍ͨͳΠϝʔδ
VTFSΛऔಘͯ͠ΈΔ औಘͰ͖ͨ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ ϥΠϒϥϦʹΑ࣮ͬͯ͞Ε͍ͯͳ͜ͱ͋Δ (SBQI2-"1*ͷಛ
ඞཁͳpFME͚ͩऔಘ͢Δ BWBUFS6SMՃͰऔಘ͢Δ
ෳͷ2VFSZΛಉ࣌ʹ͛Δ GBDFCPPLHSBQIRMϦϙδτϦऔಘͯ͠ΈΔ
ෳ"1*ʹ(&5ϦΫΤετΛૹΓ͕ͪͳ 5PQը໘ͱ͔Ͱ׆༻Ͱ͖ͦ͏ ෳͷ2VFSZΛಉ࣌ʹ͛Δ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ ϥΠϒϥϦʹΑ࣮ͬͯ͞Ε͍ͯͳ͜ͱ͋Δ (SBQI2-"1*ͷಛ
ܕ͕͔ͬ͠Γ͋Δ/VMMBCJMJUZ /VMMBCJMJUZ͕ͰΘ͔Δ
1FSNJTTJPOͱͯ͠ฦͬͯ͘Δ ͕&OVNͱͯ͠ఆٛ͞Ε͍ͯΔ ܕ͕͔ͬ͠Γ͋Δ&OVN ϦϙδτϦʹର͢Δ 1FSNJTTJPOͷpFME
ܕ͕͔ͬ͠Γ͋Δ ࣮ମͱͯ͠4USJOH͕ฦͬͯ͘Δ
w ͋ΒΏΔpFMEʹܕΛ͚ΒΕΔ w ܕʹద߹Ͱ͖͍ͯͳ͍߹ܕγεςϜ͕ΤϥʔΛฦ͢ ܕ͕͔ͬ͠Γ͋Δ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ ϥΠϒϥϦʹΑ࣮ͬͯ͞Ε͍ͯͳ͜ͱ͋Δ (SBQI2-"1*ͷಛ
w ྫɿϢʔβʔ͕ελʔ͍ͯ͠ΔϦϙδτϦΛऔಘ͢Δ w ͨ͘͞Μ͋Δ͔͠Εͳ͍ͷͰશ݅औಘΩϏγΠ w ͦ͏͍͏߹ͷͨΊͷ$POOFDUJPOͱ͍͏ܕ ࠓճͷ߹ͩͱ4UBSSFE3FQPTJUPSZ$POOFDUJPO
1BHJOBUJPO
$POOFDUJPO5ZQF"SHVNFOUT औಘ͍ͨ݅͠Λࢦఆ͢ΔͨΊʹ BSHVNFOUTͱͯ͠pSTU·ͨMBTUΛඞͣ͢ඞཁ͕͋Δ ࠷ॳͷOݸ ࠷ޙͷOݸ
$POOFDUJPO5ZQF3FUVSO5ZQF ݁ՌFEHFTOPEFʹೖ͖ͬͯͯ OPEFͷҐஔDVSTPSͰཧ͞ΕΔ ^ Α͘͏Ͱ͋Ζ͏ใ͕ 1BHF*OGPͱͯ͠༻ҙ͞Ε͍ͯΔ ^
$POOFDUJPO5ZQFTUBSSFE3FQPTJUPSZΛऔಘ TUBSSFE3FQPTJUPSZΛऔͬͯΈΔ⭐ ࠷ॳͷ݅औಘ QBHFͷใͱ͓ͬͯ͘
$POOFDUJPO5ZQFTUBSSFE3FQPTJUPSZΛऔಘ ͚݅ͩऔಘͰ͖ͨ ͜ͷҐஔΛࢦ͍ͯ͠Δ
$POOFDUJPO5ZQF$VSTPS DVSTPSΛBGUFSCFGPSFʹͤ ͦ͜Λج४ʹͯ͠pSTUMBTUΛ͏͜ͱ͕Ͱ͖Δ1BHJOBUJPO
$POOFDUJPO5ZQF$VSTPSΛࢦఆ͢Δ ઌఔͷFOE$VSTPSΛBGUFSʹͯ͠ΈΔ
Ͱ͖ͯΔ $POOFDUJPO5ZQF$VSTPSΛࢦఆ͢Δ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ ϥΠϒϥϦʹΑ࣮ͬͯ͞Ε͍ͯͳ͜ͱ͋Δ (SBQI2-"1*ͷಛ ͭͷಛͱͲ͏ͬͯ(SBQI2-"1*Λ
ୟ͘ͷ͔Λ͝ཧղ͍͚ͨͩͨͰ͠ΐ͏͔ʁ
(SBQI2-αʔόʔαΠυฤ (SBQI2-"1*αʔόʔͲͷΑ͏ʹ ࣮͢ΕΑ͍ͷ͔ʁ
(SBQI2-αʔόʔαΠυࢹ HSBQIRMSVCZ ͷ߹Ͱ͓͍͖ͤͯͨͩ͞·͢
6TFS5ZQFͷఆٛ 6TFS5ZQF ฦ͞ΕΔܕ
6TFS5ZQFͷఆٛ $POOFDUJPO5ZQFʹ͞Εͨ ҾʹԠͯ͡উखʹ-*.*5ͱ 0''4&5Λ͚ͭͯ͘ΕΔ ఆٛ ͱ 3FTPMWFS pFME໊
ܕ આ໌ OVMMBCJMJUZΛએݴ͍ͯ͘͠
(SBQI2-αʔόʔαΠυࢹ $POOFDUJPO5ZQFΛฦ͢ͱ͖ʹ ΄ͱΜͲͦΕΛҙࣝ͢Δඞཁ͕ͳͯ͘ૉΒ͍͠
6TFSRVFSZͷఆٛ VTFSRVFSZ
VTFSRVFSZͷ࣮ ฦ͢ܕ VTFSRVFSZͷҾ ͜ͷRVFSZͰฦ͢ॲཧ 2VFSZ໊ʢ6TFSVTFSʹͳΔʣ
(SBQI2-αʔόʔαΠυࢹ ͨͬͨ͜Ε͚ͩͰVTFSRVFSZ͕ ૾Ҏ্ʹ؆୯Ͱ͢ΑͶ☺ʁ
J04͔ΒͲ͏ୟ͘ʁ J04͔Βୟ͘ͱ͖Ͳ͏͢Δͷ͔ʁ
J04͔ΒͲ͏ୟ͘ʁ 1045Ͱ3FRVFTU#PEZʹԼهΛ͚ͩ͢
ੜ63-4FTTJPOͰؤுΔ
ੜ63-4FTTJPOͰؤுΔ ͜Επϥ͍
ͭΒ͍ͷͰ ϥΠϒϥϦͷྗΛआΓ͍ͨ
(SBQI2-ΫϥΠΞϯτϥΠϒϥϦ "QPMMPJ04 IUUQTHJUIVCDPNBQPMMPHSBQIRMBQPMMPJPT
"QPMMPJ04Λ͏ɿԼ४උ "QPMMPJ04Λ͏ͨΊʹ४උ͕ඞཁͰ͢
"QPMMPJ04Λ͏ɿԼ४උ ίʔυੜΛ͠·͢
"QPMMPJ04Λ͏Լ४උ schema.json of Github GraphQL ͯ͢ͷܕ2VFSZ.VUBUJPOT ใ͕ॻ͔Ε͍ͯΔ findUser.gql
(SBQIJ2-Ͱॻ͍ͨ 2VFSZΛϑΝΠϧͱͯ͠༻ҙ Apollo CLI Swift Code (FOFSBUF$PEF
"QPMMPJ04Λ͏HRMϑΝΠϧ 2VFSZʹ໊લΛ͚ͭΔ
"QPMMPJ04Λ͏ ܕͷ͋Δੈքʂ
J04͔Β(SBQI2-"1*Λୟ͘ "QPMMPJ04ͷྗΛआΓΕ 5ZQF4BGFʹ(SBQI2-"1*Λୟ͘͜ͱ͕Ͱ͖Δ
42-ϥΠΫʹ͔͚Δ ඞཁͳσʔλ͚ͩΛճͰऔಘͰ͖Δ JOUFSGBDFʹܕ͕͋Δ 1BHJOBUJPOͷ༷͕ܾΊΒΕ͍ͯΔ (SBQI2-"1*ͷಛ(SBQI2-ͷັྗ ͜ΕΒ͕ͦͷ··(SBQI2-ͷັྗʹͳΔ
w JOUFSGBDFʹܕ͕͋Δ w (SBQIJ2-͕࠷ߴ ৗʹ࠷৽ͷυΩϡϝϯτʹͳ͍ͬͯΔ ͍ͭͰࢼ͠ʹ"1*ୟ͚Δ͠ΫΤϦ࡞ΕΔ
J04ΞϓϦΤϯδχΞత(SBQI2-ͷخ͠Έ
w ⭕ΫϥΠΞϯτຖʹ"1*࡞ΓΘ͚ͳͯ͘ྑָͯ͘ w ❌ը૾ͷϑΝΠϧΛσϑΥϧτͰѻ͑ͳ͍ ϑΝΠϧΛѻ͏Օॴ͚ͩ3&45GVMʹͯ͠ରॲ͍ͯ͠Δ ʢϥΠϒϥϦΛೖΕΕѻ͑ͳ͘ͳ͍ʣ w ❌/
͕ൃੜͯ͘͢͠େม w ❌ΤϯυϙΠϯτ͕୯ҰʢBQJHSBQIRMʣͷͨΊ$BDIF͍͠ ͍··Ͱͷݟ͕͋·Γ͑ͳ͍ αʔόʔαΠυࢹͰ
(SBQI2-ͷπϥϛ ͯ͞ʜʜπϥϛͷΛ͠·͢
(SBQI2-ͷπϥϛ ΤϥʔϋϯυϦϯά͕͍͠
ΤϥʔͲ͏དྷΔͷ͔ Τϥʔ͜Μͳײ͡ͰདྷΔ
w ෳͷ2VFSZ.VUBUJPOΛಉ࣌ʹୟ͘ͱҰ෦ޭͯ͠ Ұ෦ࣦഊͱ͔͕ى͜Γ͏Δ w ͲΕ͕ΫϦςΟΧϧͳͷͳͷ͔ͷஅ͕ඞཁ (SBQI2-ͷπϥϛɿΤϥʔϋϯυϦϯά ͍ͭͲ͓Γؤுͬͯߟ͑ͯΔ͔͠ͳ͍
(SBQI2-ͷπϥϛ TUBUVT$PEF͕جຊͰฦͬͯ͘Δ
w TUBUVT$PEFجຊͰฦͬͯ͘Δ w (SBQI2-ϦΫΤετ͕௨Ε w BQPMMPJPT͔ΒTUBUVT$PEF͕ݟ͑ͳ͘ͳ͍ͬͯΔ w .VUBUJPOʢߋ৽ܥʣ͕ಛʹπϥ͍
(SBQI2-ͷπϥϛɿTUBUVT$PEF
w (SBQI2-2VFSZ͕ͱͯັྗత͕ͩ.VUBUJPOͦΕ΄Ͳ w ߋ৽ܥ(SBQI2-Ͱ͋Δ͋Γ͕ͨΈ͕΄ͱΜͲͳ͍ .VUBUJPOʹର͢Δݸਓతݟղ
͜ͷπϥϛΛͳΜͱ͔ղܾͰ͖ͳ͍͔ͳ…ʁ (SBQI2-ͷπϥϛ
TUBUVT$PEF͕ ·ͣ(SBQI2-"1*ଆͰΤϥʔͷ༰Λ֦ு͢Δ
"1*ଆͰΤϥʔΛ֦ு͢Δ (SBQI2-"1*ଆͰΤϥʔΛ֦ுͯ͠ TUBUVT$PEFΛϨεϙϯεʹ༩͢Δ
ΞϓϦଆͰTUBUVT$PEFΛࢀর͢Δ TUBUVT$PEFΛऔΓग़͢
ͳΜͱ͔ͳͬͯΔؾ͕͢Δʜʁ TUBUVT$PEF͕
͔͠͠ϫΠࢥͬͨ ʮ͍ϫΠɺ.VUBUJPOͷ݁Ռ ී௨ʹ4UBUVT$PEFͰϋϯυϦϯά͍ͨ͠Μ͡Όʔʯ
͔͠͠ϫΠࢥͬͨ ͳ͔ͥͱ͍͏ͱ
#BDLFOET'PS'SPOUFOET Payment Image/Movie Notification Core Domain (SBQI2- BFF
iOS App ฐαʔϏε.JDSPTFSWJDFTߏ 3&45GVM 3&45GVM 3&45GVM ͦͦ3&45GVM"1*ୟ͔ͳ͍ͱ͍͚ͳ͍͜ͱ͕͋Δ
#''Λ༻͍ͨࠇຐज़ J04͔ΒΈͯ.VUBUJPOʢߋ৽ܥʣ͚ͩ3&45ͬΆ͘ ৼΔΘͤΔ͜ͱͰ͖·͢
GraphQL API BFF iOS App ᶄ (SBQI2-ͷ .VUBUJPOʹ
Ϛοϐϯά ᶆ “errors”: [{ “statusCode”: 400 }] ᶇ FSSPSTpSTUTUBUVT$PEFΛ )5514UBUVT$PEFͱ͢Δ ᶈ )5514UBUVT$PEF ͰϋϯυϦϯά ᶃ 63-4FTTJPOͰ 1045BQJDSFBUF/PWFM #''Λ༻͍ͨࠇຐज़ ᶅ Mutation createNovel()
#''Λ༻͍ͨࠇຐज़ Ͱ͖·ͨ͠☺
#''Λ༻͍ͨࠇຐज़ ͜͏͍͏;͏ʹͰ͖ΔΑ͍ͬͯ͏͚ͩͳͷͰ Φεεϝ͠·ͤΜ2 ͔ͨ͠͠Β͜Ε͕ΠΠͬͯͳΔ͜ͱ͋Δ͔ʜʁ
w (SBQI2-ͳ͔ͳ͔͍͍ͧ JOUFSGBDFʹܕ͕͋Δͷ࠷ߴ (SBQIJ2-࠷ߴ w (SBQI2-ΤϥʔϋϯυϦϯά͕݁ߏΉ͔͍ͣͧ͠ #FTU1SBDUJDF͕͋·Γͳ͘ͱͯ·͍͠
·ͱΊ ࠙ձฐࣾ%F/"ϒʔεͰ͍ͭͰ͓͕͚͍ͩ͘͞ʂ
ࢀߟࢿྉ
w BQPMMPΛOQNJOTUBMM OQNJHBQPMMP w BQPMMPΛͬͯ(JUIVC(SBQI2-"1*ͷTDIFNBΛऔಘ BQPMMPTDIFNBEPXOMPBEFOEQPJOUIUUQTBQJHJUIVCDPNHSBQIRIFBEFS"VUIPSJ[BUJPO#FBSFSUPLFO TDIFNBKTPO w
(SBQIJ2-Ͱॻ͍ͨRVFSZʹ໊લ͚ͭͯHRMϑΝΠϧͱͯ͠อଘ w TDIFNBͱHRM͔ΒBQPMMPΛͬͯίʔυੜ BQPMMPDPEFHFOHFOFSBUFRVFSJFTpOE6TFSHRMTDIFNBTDIFNBKTPO"1*TXJGU "QPMMPJ04Λ͏Լ४උʢৄࡉʣ