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
Introduction to GraphQL (Reactathon)
Search
jnwng
March 20, 2018
Technology
190
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to GraphQL (Reactathon)
Talk given at Reactathon 2018 3/20/2018
jnwng
March 20, 2018
More Decks by jnwng
See All by jnwng
Evolving the Graph
jnwng
1
310
An Introduction to GraphQL (ReactJS SF Bay Area)
jnwng
0
160
Providing Flexibility Through Constraint
jnwng
0
110
Introduction to GraphQL
jnwng
1
590
Going GraphQL First - ReactSF
jnwng
0
220
Going GraphQL First
jnwng
5
770
keeping up with javascript
jnwng
3
1.1k
Presentations 101
jnwng
1
270
SViOS Meetup: HTTP Live Streaming
jnwng
2
420
Other Decks in Technology
See All in Technology
Essential architectural thinking (revised edition)
ufried
0
110
AI時代だからこそ推したい!Gitコマンド再入門
munakata
0
180
Kiro Crewをはじめよう
kizawa2020
1
140
Claude Code本は、どのように執筆チームで書かれたか
oikon48
1
360
ai_cording_with_k8s_knowledge.pdf
mochizuki875
1
340
今さら理解するウェブフォントver.2026
takanorip
3
680
しろおびから始める!ログ活用の第一歩
shumei_ito
0
910
Classmethod Company Deck
satoshi7
0
130
メルペイ 会計システム概要と歴史
mewuto
0
210
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
8
2.2k
夫婦で子育てするための育児標準化
codmoninc
PRO
0
190
DWH の限界突破! AI エージェント向け爆速リアルタイムデータ基盤 ClickHouse
jozono
1
390
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
19k
WENDY [Excerpt]
tessaabrams
14
40k
The Curious Case for Waylosing
cassininazir
1
570
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
First, design no harm
axbom
PRO
2
1.3k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
450
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Deep Space Network (abreviated)
tonyrice
0
360
Site-Speed That Sticks
csswizardry
13
1.6k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Transcript
An Introduction To GraphQL Reactathon, March 20, 2018
Jon Wong Frontend Infrastructure, Coursera @jnwng 2
Runtime ▪ Clients ▪ Servers ▪ Tools What We’re Covering
in GraphQL Language ▪ Schemas ▪ Queries 3
What is GraphQL? Taken straight from GraphQL.org
Describe your Data type Project { name: String tagline: String
contributors: [User] } 5
Ask for What You Want query { project(name: "GraphQL") {
tagline } } 6
Get Predictable Results query { project(name: "GraphQL") { tagline }
} 7 { "project": { "tagline": "A query language for APIs" } }
Schemas Describing possible data
Describe everything that is possible ▪ All possible data results
are described by the server. 9
Validation ▪ Every query is validated against the GraphQL schema
▪ No runtime errors for query documents 10
The GraphQL Schema gives us the basis of everything that
is possible when communicating to the server from the client. 11
Queries Reading your data
13 A simple query query { project(name: "GraphQL") { tagline
} } { "project": { "tagline": "A query language for APIs" } }
14 A simple query query { project(name: "GraphQL") { tagline
author } } { "project": { "tagline": "A query language for APIs", “author”: “jnwng” } }
Fragments fragment MyFancyFragment on MyResource { someField } 15 These
are required!
Spreading a fragment in a query query { someResource {
...MyFancyFragment } } 16 These two types should match
17 A typical React application
18 … broken down into components ...
19 A complex query
20 A complex query
21 A complex query query CoursePage { course(slug: “Machine Learning”)
{ title description ...University ...Instructor } }
22 ▪ Components can be more portable ▪ Components are
more self-sufficient. Every component can declare its own data requirements
GraphQL queries allow the client to declare exactly what it
needs, in the form that it needs it in. 23
Clients Managing your data
Clients make it easier to manage data Relay Apollo 25
Caching ▪ Clients provide advanced caching for GraphQL queries. 26
Caching query ListView { allBooks { id name } }
27 query DetailView ($id: ID) { bookById(id: $id) { name } }
Clients make adopting GraphQL in your application a breeze. 28
Servers Serving your data
Mapping types to resolvers 30 const schemaDefinition = ` type
Query { books: [Book] } type Book { title: String author: String } `; const resolvers = { Query: { books: () => fetch('https://api.com/books') }, };
Every field can be resolved separately. 31 const resolvers =
{ Query: { books: () => fetch('https://api.com/books') }, Book: { title: () => return ‘The book title’, author: () => fetch(‘https://api.com/authors’) } };
A single endpoint for data from anywhere { books {
title author } } 32
GraphQL servers are flexible 33 ▪ They can act as
proxies to existing data ▪ They can also act as the business logic layer itself
Tools Supercharging your data
GraphiQL 35
`eslint-plugin-graphql` 36 Catch invalid API calls at compile-time
`apollo-codegen` 37 Catch runtime errors at compile-time
GraphQL enables an entire ecosystem of tools to make developers
more effective. 38
▪ GraphQL makes it really simple to query lots of
data, no matter where it is. 39 In Summary
▪ Just like React, GraphQL can break down complexity into
composable, reusable pieces 40 In Summary
▪ GraphQL.org ▪ GraphQL.com ▪ https://launchpad.graphql.com/ new 41 How to
Get Started
THANKS! 42 @jnwng Presentation template by SlidesCarnival