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
Oh Hello Apollo client, Goodbye Redux!
Search
Ankita Kulkarni
March 31, 2021
Programming
550
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Oh Hello Apollo client, Goodbye Redux!
Ankita Kulkarni
March 31, 2021
More Decks by Ankita Kulkarni
See All by Ankita Kulkarni
5 things you must know to take your Next app to the next level
kulkarniankita09
0
350
Lessons learned: Architecting react apps
kulkarniankita09
1
330
Beyond the React Native Benchmark
kulkarniankita09
0
160
Accessibility 360 - Web -> Mobile
kulkarniankita09
0
160
Make your React Native apps accessible 🙌
kulkarniankita09
0
310
Let's fight - Redux side-effects showdown
kulkarniankita09
0
270
The Art of Humanizing Pull Requests
kulkarniankita09
0
790
Being Agile - Scrum and Extreme Programming
kulkarniankita09
0
170
Other Decks in Programming
See All in Programming
AIと壁打ちしながら進めるコスト管理
fufuhu
2
1.9k
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
7
2.3k
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
120
Can LLMs Replicate 4 Years of Compose Migration? Exploring the boundaries of automation with 279 XML files from a real product
makun
0
130
[DroidKaigi 2026] Bring your own phones to Gradle Managed Devices
f2lk
0
110
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
250
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
140
【デモ】Kiroで体験する仕様駆動開発|設計からコーディングまでAIと進める開発フロー
cmkudo
0
570
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
830
PHPプロジェクトの結合バランスを可視化する #php_night
kajitack
0
210
自分的「カンファレンスの楽しみ方」
syumai
0
190
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
Ethics towards AI in product and experience design
skipperchong
2
360
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
390
sira's awesome portfolio website redesign presentation
elsirapls
0
400
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
870
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
Building AI with AI
inesmontani
PRO
1
1.2k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
590
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.8k
Agile that works and the tools we love
rasmusluckow
331
22k
Transcript
@kulkarniankita9 Oh hello Apollo Client, Farewell Redux Ankita Kulkarni, Loblaw
Digital
@kulkarniankita9 Hi, I’m Ankita!
@kulkarniankita9 Let’s take a step back first! 🤚
@kulkarniankita9 What is a good state manager? 🤔
@kulkarniankita9 Data is normalized 💯
@kulkarniankita9 Data transforms Consistently 𝌡
@kulkarniankita9 Visualize global state 🧙
@kulkarniankita9 Debugging is not hard 🔎
@kulkarniankita9 You can write tests ✅
@kulkarniankita9 We all know a library that was good at
this! ☺
@kulkarniankita9 Redux fixes everything ✨
@kulkarniankita9 What is Redux? Source: https://bumbu.me/simple-redux/
@kulkarniankita9 Redux world request CART SUCCESS CART ERROR CART REQUEST
ActionType.CART_REQUEST ActionType.CART_ERROR ActionType.CART_SUCCESS
@kulkarniankita9 Async request in redux
@kulkarniankita9 Then why switch….? 😅
@kulkarniankita9 Apollo GQL happened 👏
@kulkarniankita9 After Apollo Client hooks 🚀,
@kulkarniankita9 No need for actions 🙅 CART SUCCESS CART FAILURE
CART REQUEST ActionType.LOGIN_REQUEST ActionType.LOGIN_FAILURE ActionType.LOGIN_SUCCESS
@kulkarniankita9 It still doesn’t replace Redux, not convinced 🙄
@kulkarniankita9 I still had questions, how do we? • Normalize
data • Handle async actions • Trigger state updates in the component • And remember selectors? • Transform data
@kulkarniankita9
@kulkarniankita9 Apollo Client 3 is here…✨✨✨
@kulkarniankita9 Difference between Redux and Apollo client
@kulkarniankita9 Apollo client does the heavy lifting for you 💪
@kulkarniankita9 Let’s revisit state management principles
@kulkarniankita9 My data is normalized (no dupes please 🙏)
@kulkarniankita9 Apollo client 🚀 • automatically caches your data by
generating a unique ID • Normalizes new data in query responses and after mutation • Stores data using references so it can look up data easily
@kulkarniankita9 Root Query
@kulkarniankita9 You need to understand the internal workings of the
Apollo client!!! ←
@kulkarniankita9 Data transformations
@kulkarniankita9 Let’s look at some examples
@kulkarniankita9 Cart Query
@kulkarniankita9 Out of stock / Low stock msg (react)
@kulkarniankita9 How can we achieve the same in Apollo client?
🚀
@kulkarniankita9 What are Local only fields 🦋
@kulkarniankita9 @client
@kulkarniankita9 Local only fields 🦋
@kulkarniankita9 To access in a component 🦋
@kulkarniankita9 What about fields that don’t need to be defined
in in a GQL type?
@kulkarniankita9 • Store local state outside the Apollo client cache
• You can store whatever you want in whatever shape you want • Modifying them triggers a update Reactive variables 🌸
@kulkarniankita9 Reactive variables 🌸
@kulkarniankita9 Reactive variables 🌸
@kulkarniankita9 Isn’t that cool? 🔥
@kulkarniankita9 Debugging with Apollo client
@kulkarniankita9 Visualize your cache 🧙
@kulkarniankita9 Visualize your cache 🧙 Link!
@kulkarniankita9 Testing! ✅
@kulkarniankita9 Testing! ✅
@kulkarniankita9 Keep an open mind 😇
@kulkarniankita9 Take away 🚀 • You take control or give
away your control a little • In Redux, we were doing a LOT! • Using Redux and Apollo client with GQL redundant data • You need to understand how Apollo client works
@kulkarniankita9 It’s a mindset shift 💯
@kulkarniankita9 This is pretty much the end.. Questions? Comments? Feedback…make
it positive—😉 Catch me after on Twitch!!
@kulkarniankita9 You did it 👏