SlideShare a Scribd company logo
Relay Local State
Management:
Replacing Redux
Relay Local State
Management:
Replacing Redux
React Floripa
Joao Marins
@jgcmarins
Topics
- What’s Relay?
- Query
- Mutation
- commitMutation
- commitLocalUpdate
- Local Schema
- Real Scenario
- What’s next?
PS: This presentation does not cover discussion about Relay vs Apollo.
Relay
https://github.com/facebook/relay
- GraphQL Client
- Data fetch problem
- State management
- Collocation
- Compile queries
Query
Mutation
commitMutation
commitLocalUpdate
Local Schema
Client Schema
Local State
“Amongst the shrouds of the Relay source code, there are many a treasure to be
found. One of these treasures is rumoured to be none other, than local state.”
Benjamin A. Bangsund
clientSchema.graphql
commiLocalUpdate
+
clientSchema.graphql
Real scenario
User Location
clientSchema.graphql
UserLocation.tsx:
Collocation + Fetch
- We can use this component on
every place we want to render user
location.
- We could save more info besides
lat and lng, like place, street,
zipcode and so on.
- We should add a comparison logic
with location saved on Relay Store
before fetch Google again.
What’s Next?
Offline First Apps
https://github.com/morrys/wora
References
- https://relay.dev
- https://github.com/facebook/relay/issues/1656
- https://babangsund.com/relay_local_state_management
- https://babangsund.com/relay_local_state_management_2
- https://github.com/facebook/relay/pull/2821
- https://github.com/babangsund/react-relay-local-query
- https://github.com/morrys/wora
Thanks
We’re hiring!

More Related Content

PDF
Let's talk about GraphQL
Commit Software Sh.p.k.
 
PDF
Streaming at Lyft, Gregory Fee, Seattle Flink Meetup, Jun 2018
Bowen Li
 
PPT
GCF Application server
Aneesh Muralidharan
 
PDF
Simplified News Analytics in Presidential Election with Google Cloud Platform
Imre Nagi
 
PDF
Flink Forward Berlin 2018: Shriya Arora - "Taming large-state to join dataset...
Flink Forward
 
PDF
Functional APIs with Absinthe GraphQL
Zvi Avraham
 
PPTX
Join semantics in kafka streams
Knoldus Inc.
 
PPTX
PivotBillions: Analyzing 1.5 Billion Rows of NYC Taxi Data
Michael Nam
 
Let's talk about GraphQL
Commit Software Sh.p.k.
 
Streaming at Lyft, Gregory Fee, Seattle Flink Meetup, Jun 2018
Bowen Li
 
GCF Application server
Aneesh Muralidharan
 
Simplified News Analytics in Presidential Election with Google Cloud Platform
Imre Nagi
 
Flink Forward Berlin 2018: Shriya Arora - "Taming large-state to join dataset...
Flink Forward
 
Functional APIs with Absinthe GraphQL
Zvi Avraham
 
Join semantics in kafka streams
Knoldus Inc.
 
PivotBillions: Analyzing 1.5 Billion Rows of NYC Taxi Data
Michael Nam
 

What's hot (20)

PDF
Building an analytics workflow using Apache Airflow
Yohei Onishi
 
PDF
End to-end large messages processing with Kafka Streams & Kafka Connect
confluent
 
PDF
Writing an Interactive Interface for SQL on Flink
Eventador
 
PDF
Stream Processing Live Traffic Data with Kafka Streams
Tim Ysewyn
 
PPTX
Transforming Rasters and Point Clouds
Safe Software
 
PDF
MapMyCab Presentation
Preetika Kulshrestha
 
PDF
Streaming sql w kafka and flink
Kenny Gorman
 
PPTX
CitySDK Workshop Feedback
Tyrone Grandison
 
PDF
Selenium camp 2017. Alexander Chumakin
Alex Chumakin
 
PDF
Kafka Streams
Cristiano Altmann
 
PDF
Airflow tutorials hands_on
pko89403
 
PDF
Real time observability with Redis and Grafana
Mikhail Volkov
 
PDF
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Burasakorn Sabyeying
 
PDF
Kubernetes Config Management Landscape
Tomasz Tarczyński
 
PDF
Cypher for Apache Spark
openCypher
 
PDF
I²: Interactive Real-Time Visualization for Streaming Data with Apache Flink ...
Jonas Traub
 
PPTX
Intro to RxJS
Alan Fadliawan
 
PDF
Building a Data Ingestion & Processing Pipeline with Spark & Airflow
Tom Lous
 
PDF
redBorder: Open or die
Nextel S.A.
 
Building an analytics workflow using Apache Airflow
Yohei Onishi
 
End to-end large messages processing with Kafka Streams & Kafka Connect
confluent
 
Writing an Interactive Interface for SQL on Flink
Eventador
 
Stream Processing Live Traffic Data with Kafka Streams
Tim Ysewyn
 
Transforming Rasters and Point Clouds
Safe Software
 
MapMyCab Presentation
Preetika Kulshrestha
 
Streaming sql w kafka and flink
Kenny Gorman
 
CitySDK Workshop Feedback
Tyrone Grandison
 
Selenium camp 2017. Alexander Chumakin
Alex Chumakin
 
Kafka Streams
Cristiano Altmann
 
Airflow tutorials hands_on
pko89403
 
Real time observability with Redis and Grafana
Mikhail Volkov
 
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Burasakorn Sabyeying
 
Kubernetes Config Management Landscape
Tomasz Tarczyński
 
Cypher for Apache Spark
openCypher
 
I²: Interactive Real-Time Visualization for Streaming Data with Apache Flink ...
Jonas Traub
 
Intro to RxJS
Alan Fadliawan
 
Building a Data Ingestion & Processing Pipeline with Spark & Airflow
Tom Lous
 
redBorder: Open or die
Nextel S.A.
 
Ad

Similar to Relay Local State Management: Replacing Redux (18)

PDF
GraphQL With Relay Part Deux
Brad Pillow
 
PPTX
Building GraphQL Applications with Relay - GraphQL Manchester #1
Chris Grice
 
PDF
Exploring Relay land
Stefano Masini
 
PDF
A Blog About Using State in Next.js: Valuable Insights
Shiv Technolabs Pvt. Ltd.
 
PPTX
STATE MANAGEMENT IN REACT [Autosaved].pptx
siddheshjadhav919123
 
PPTX
Relay: Seamless Syncing for React (VanJS)
Brooklyn Zelenka
 
PPT
Architectural peripherals of react by Vadym Zhiltsov
Lohika_Odessa_TechTalks
 
PDF
GraphQL and Relay Modern
Carmel JavaScript Roundabout
 
PDF
GraphQL And Relay Modern
Brad Pillow
 
PDF
GraphQL And Relay Modern
Brad Pillow
 
PDF
貴圈真亂 React生態圈
Ben Liu
 
PPTX
React Flux to GraphQL
Turadg Aleahmad
 
PDF
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
Pavel Chertorogov
 
PDF
Recoil at Codete Tech Talks with Cloudinary
Mateusz Bryła
 
PDF
Tokyo React.js #3: Missing Pages: ReactJS/Flux/GraphQL/RelayJS
Khor SoonHin
 
PDF
React native meetup 2019
Arjun Kava
 
PPTX
Getting started with react & redux
Girish Talekar
 
PDF
Local state management with Apollo | Виталий Паршиков | Zlit Tech
Zlit
 
GraphQL With Relay Part Deux
Brad Pillow
 
Building GraphQL Applications with Relay - GraphQL Manchester #1
Chris Grice
 
Exploring Relay land
Stefano Masini
 
A Blog About Using State in Next.js: Valuable Insights
Shiv Technolabs Pvt. Ltd.
 
STATE MANAGEMENT IN REACT [Autosaved].pptx
siddheshjadhav919123
 
Relay: Seamless Syncing for React (VanJS)
Brooklyn Zelenka
 
Architectural peripherals of react by Vadym Zhiltsov
Lohika_Odessa_TechTalks
 
GraphQL and Relay Modern
Carmel JavaScript Roundabout
 
GraphQL And Relay Modern
Brad Pillow
 
GraphQL And Relay Modern
Brad Pillow
 
貴圈真亂 React生態圈
Ben Liu
 
React Flux to GraphQL
Turadg Aleahmad
 
React, GraphQL и Relay - вполне себе нормальный компонентный подход (nodkz)
Pavel Chertorogov
 
Recoil at Codete Tech Talks with Cloudinary
Mateusz Bryła
 
Tokyo React.js #3: Missing Pages: ReactJS/Flux/GraphQL/RelayJS
Khor SoonHin
 
React native meetup 2019
Arjun Kava
 
Getting started with react & redux
Girish Talekar
 
Local state management with Apollo | Виталий Паршиков | Zlit Tech
Zlit
 
Ad

Recently uploaded (20)

PPTX
Presentation about variables and constant.pptx
kr2589474
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Immersive experiences: what Pharo users do!
ESUG
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
PPTX
Explanation about Structures in C language.pptx
Veeral Rathod
 
PDF
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
PDF
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
PPTX
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
PDF
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
PDF
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
PDF
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Presentation about variables and constant.pptx
kr2589474
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Immersive experiences: what Pharo users do!
ESUG
 
Activate_Methodology_Summary presentatio
annapureddyn
 
MiniTool Power Data Recovery Crack New Pre Activated Version Latest 2025
imang66g
 
Explanation about Structures in C language.pptx
Veeral Rathod
 
lesson-2-rules-of-netiquette.pdf.bshhsjdj
jasmenrojas249
 
New Download MiniTool Partition Wizard Crack Latest Version 2025
imang66g
 
Exploring AI Agents in Process Industries
amoreira6
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Presentation about variables and constant.pptx
safalsingh810
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
AI-Ready Handoff: Auto-Summaries & Draft Emails from MQL to Slack in One Flow
bbedford2
 
The-Dawn-of-AI-Reshaping-Our-World.pptxx
parthbhanushali307
 
Using licensed Data Loss Prevention (DLP) as a strategic proactive data secur...
Q-Advise
 
Balancing Resource Capacity and Workloads with OnePlan – Avoid Overloading Te...
OnePlan Solutions
 
49785682629390197565_LRN3014_Migrating_the_Beast.pdf
Abilash868456
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 

Relay Local State Management: Replacing Redux