Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Lightning Talk at JSConf 2015
Dafeng
July 12, 2015
Programming
12
860
Lightning Talk at JSConf 2015
Quick intro to GraphQL and Relay
Dafeng
July 12, 2015
Tweet
Share
More Decks by Dafeng
See All by Dafeng
dfguo
6
1.8k
dfguo
6
900
dfguo
6
360
Other Decks in Programming
See All in Programming
oracle4engineer
0
120
manfredsteyer
PRO
0
120
lovee
2
220
heistak
2
130
watilde
5
1.5k
gernotstarke
0
390
abeta
1
210
tetsukick
0
180
panini
1
160
ntaro
0
170
tkmnzm
0
140
pirosikick
4
960
Featured
See All Featured
iamctodd
19
2k
smashingmag
283
47k
trishagee
24
2.6k
destraynor
146
19k
kneath
219
15k
malarkey
193
8.6k
bkeepers
408
58k
trallard
14
720
shpigford
369
42k
smashingmag
230
18k
jmmastey
10
630
roundedbygravity
242
21k
Transcript
GraphQL and Relay Lightning Talk at JSConf 2015
About me • Dafeng Guo, CTO of strikingly.com • Strikingly
• simplest website builder • probably the largest React.js user in China
GraphQL What the hell is it?
None
None
“REST is perfect!” - A random backend engineer
REST-ful API Sometimes Sucks • Round trip for complicated objects
• Variable fields • Custom endpoint - not REST-ful design • Backend engineer dependency - slow down iterations
GraphQL • Server-side engineers published a type system • Client-side
engineers use GraphQL as a unified query interface • No more adhoc endpoints • Product changes are faster
None
Are we writing SQL in the client?! NO!
GraphQL Query JSON Response
GraphQL • REST-ful sometimes sucks • GraphQL is declarative •
GraphQL allows product engineers to iterate faster • Draft spec was released
Relay GraphQL on React
Component • Component is at the core of React •
Reusing any component, we are reusing • HTML - React • Javascript - React • CSS - Maybe React? • Data fetching - Relay
Relay • Allows you to define the data format the
component needs using GraphQL • Relay automatically fetch the data • Supports nested/composite components
Relay • Solving the data fetching problem • Supports composite
components • Makes component reuse possible • Will be open sourced in August
Thanks!