Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
20年続いているサービスの複雑な注文画面を GraphQL を使って改善した話
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
株式会社出前館
October 27, 2022
Technology
500
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
20年続いているサービスの複雑な注文画面を GraphQL を使って改善した話
株式会社出前館
October 27, 2022
More Decks by 株式会社出前館
See All by 株式会社出前館
出前館のメニュー登録・更新用APIをSpring Boot+Kafkaで実現したお話
demaecan
0
230
現実的なセキュリティ体制の構築 限られたリソースの中で成果を最大化する「選択と集中」
demaecan
7
4.8k
中期計画、2回作ってみた ~業務委託と正社員、両方の視点から~
demaecan
1
1.2k
複雑にからみあう複数のシステムを要する出前館QAの実情、展望
demaecan
0
220
QA業務を変える(!?)AIを併用した不具合分析の実践
demaecan
0
260
出前館アプリの品質を支えるリリーストレインとその実践
demaecan
0
290
出前館アプリ進化論 アーキテクチャと組織のリアルな変⾰の舞台裏
demaecan
0
970
Flutterにしてよかった?出前館アプリを2年運用して気づいたことを全部話します
demaecan
1
1.4k
Boxを“使われる場”にする統制と自動化の仕組み
demaecan
1
530
Other Decks in Technology
See All in Technology
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
3
960
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
630
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
2.5k
AI時代のAPI品質を支えるガードレール / API Guardrails for API quality in the AI era
yokawasa
1
210
From Vanilla Kubernetes to a Batteries-Included Platform: Developer Experience at 1,300+ Clusters
yosshi_
0
680
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
130
HRC_Frontend_Conference_Fukuoka_2026.pdf
ts020
0
350
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
8
7.7k
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
140
Sigmaユーザーのための有用リソース一挙公開 & Sigmaで使えるMCP #sigma_ucj /useful-resources-for-sigma-computing-users-and-mcps-with-sigma
shinyaa31
0
180
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
260
作り直せるコードは迅速に 作り直せないDBは慎重に - AI時代のプロダクトエンジニアが「判断の不可逆性」で開発速度を変える話
kinosuke01
0
300
Featured
See All Featured
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Paper Plane (Part 1)
katiecoart
PRO
1
11k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
520
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Odyssey Design
rkendrick25
PRO
2
800
Building AI with AI
inesmontani
PRO
1
1.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6.2k
Transcript
20年続いているサービスの 複雑な注文画面を GraphQLを使って改善した話 株式会社出前館・橋本茉利奈
橋本茉利奈 Hashimoto Marina 株式会社出前館 モバイルアプリエンジニア
None
出前館アプリ
注文画面
None
お届け時間
お届け時間 決済方法
お届け時間 決済方法 クーポン利用
お届け時間 決済方法 クーポン利用 LINEポイント
お届け時間 決済方法 クーポン利用 LINEポイント 特典の付与
お届け時間 決済方法 クーポン利用 LINEポイント 特典の付与 料金の再計算
お届け時間 決済方法 クーポン利用 LINEポイント 特典の付与 料金の再計算 めっちゃ切り替わる…😵
状態管理が大変…😵
状態管理が大変…😵 • 画面内に状態を管理しなければいけない要素が多い • 増え続ける決済パターン • ユーザ操作によって切り替わる注文情報 • ユーザへの許諾チェックボックスの表示制御 …etc
どうする…🤔
とにかくシンプルを目指す
RecoilをState管理に使ってみた • ねらい:State管理をできるだけシンプルにする • 要素をできるだけ細かく分解して管理する • Stateをどこからでも呼び出せる
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method 依存関係が多すぎる…😵
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method 頻繁に更新される…😵
screen RecoilをState管理に使ってみた Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method かえって複雑に…😵
どうする…🤔
状態を2種類にわける
Server Cache / Local State
Server Cache • サーバの情報を保持するキャッシュ • サーバとクライアントの情報の一致が常に保証されている • キャッシュの値がコンポーネントへリアクティブに作用する
Local State • クライアントでのユーザ操作による情報を管理するState • クライアントのみで一時的に保持している値を管理
screen Server Cache / Local State Server user input Server
Cache Local State
注文画面で実装する💪
注文画面で実装する💪 • Server Cache → Apollo Client のキャッシュを使う • Local
State → React useState を使う
screen 注文画面で実装する💪 Apollo Server (BFF) user input Apollo Client Cache
useState
注文画面で実装する💪 • Server Cache → Apollo Client のキャッシュを使う • Local
State → React useState を使う
Server Cache→ apollo client のキャッシュを使う • BFFのレスポンス情報自体を、Server Cacheとして保持する • BFF
(GraphQL) によって、1画面描画のためのリクエストが1回で 済むのでServer Cacheの状態管理が容易 • BFFのスキーマで型定義できる
注文画面で実装する💪 • Server Cache → Apollo Clientのキャッシュを使う • Local State
→ React useState を使う
Local State → React useState を使う • Server Cacheのおかげで、Localで独自に定義するStateを減らすこと ができる
screen Before... Recoil Server user input item info amount coupon
delivery type LINE point order type terms agreement isEnabled receipt address phone number payment method
screen After... Apollo Server (BFF) user input Apollo Client Cache
useState isEnabled address payment method
まとめ
まとめ • 注文画面は、出前館アプリの中でも状態管理が大変な画面のひとつ • まずRecoilで管理する方法を試したものの、膨大な量のStateを管 理しなければならず、大変なことに...
まとめ • そこで、画面で管理するStateをSever CacheとLocal Stateの2種類に 分類して管理することにした
まとめ • Server Cacheとして, Apollo Client のキャッシュを活用することで 、型安全で、かつシンプルにサーバ情報を保持できるようになった
まとめ • Server Cacheがあるおかげで、ユーザ操作によって更新がかかる StateのみをLocal Stateで管理すれば良くなった
None