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
GraphQL & beyond
Search
Felipe Luiz Soares
November 17, 2018
Technology
61
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL & beyond
Felipe Luiz Soares
November 17, 2018
More Decks by Felipe Luiz Soares
See All by Felipe Luiz Soares
Writing unit tests with Jest using test best practices
felipesoares6
0
200
Comecei uma tarefa e olha no que deu!
felipesoares6
0
62
HTML + CSS
felipesoares6
1
160
THE MEANING OF LIFE FRONT-END USER EXPERIENCE AND EVERYTHING
felipesoares6
0
68
BEM
felipesoares6
0
80
Read-Search-Ask
felipesoares6
1
100
Other Decks in Technology
See All in Technology
事業課題から技術的負債に向き合う
sansantech
PRO
2
550
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
Tips for Building Useful Agent Skills
rstankov
0
110
Omarchy Quattro の日本語設定周り
simosako
2
170
なぜJMBC(Japan MCP Business Community)? MCPってどう活用できるの?
cdataj
0
110
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
220
Claude Code本って、 読む必要あるの?
oikon48
2
440
2026-09-09 【sigma_ucj#1】Sigma を IaC 管理したい! / IaC for Sigma
civitaspo
0
130
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
180
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
200
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
160
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
490
Music & Morning Musume
bryan
47
7.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Scaling GitHub
holman
464
140k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Amusing Abliteration
ianozsvald
1
290
A designer walks into a library…
pauljervisheath
211
25k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
790
Color Theory Basics | Prateek | Gurzu
gurzu
0
460
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Transcript
GRAPHQL & beyond @felipesoares_
why how when
@felipesoares6_ felipesoares6
None
None
None
None
GraphQL is a query language
& alternative to REST
None
+
graphs -> nodes -> edges
query language SELECT * FROM
type House { edge: Person } type Person { ...
}
why?
None
3 reasons
get just what you want
enables declarative data fetching
overfetching
underfetching
nice and smooth contracts
+ typed schemas + docs
playground
clients everywhere
only exposes a single endpoint
consume the same endpoint in != ways
how?
-> schema -> queries -> mutations -> resolvers -> responses
schema
type Query { users: [User!]!, user: User! }
type User { id: ID!, name: String, email: String }
schema -> queries -> mutations resolvers responses
queries
GET /users query { users { id, name, email }
}
mutations
POST /users mutation { createUser( name: “Felipeson”, email: “
[email protected]
” )
{ id } }
schema queries mutations -> resolvers responses
resolvers
resolvers = { Query: { users: () => getUsers(), user:
(_, { id }) => getUser(id), ???: () => fetch(‘api.com/top’) } }
schema queries mutations resolvers -> responses
responses
loading
“data”: { users: [ { id: “1”, name: “Felipe Soares”,
email: “
[email protected]
” } ] } query { users { id, name, email } }
“errors”: [ { “message”: “error”, “location”: … , “fields”: ...
} ] query { users { id, name, gender } }
how how
server-side bit.ly/2OYP9IS
prisma
data-base layer
None
application layer
None
client-side bit.ly/2zRBNUq
apollo
query
import gql from ‘graphql-tag’ import { Query } from ‘react-apollo’
const GET_USERS = gql` query { users { id, name,
email } }`
<Query query={GET_USERS}> {({ load, error, data }) => { ...
} </Query>
if (load) { return <Load load={load} /> }
if (data.users) { return <List items={data} /> }
if (error) { return <Error error={error} /> }
mutation
import gql from ‘graphql-tag’ import { Mutation } from ‘react-apollo’
const CREATE_USER = gql` mutation { createUser( name: “Felipeson”, email:
“
[email protected]
” ) { id, name, email } }`
<Mutation mutation={CREATE_USER}> {( createUser , { load, error, data })
=> { ... } </Mutation>
<div> ... <UserForm submit={createUser} /> </div>
when?
is difficult to close the API contracts
overfetching underfetching
consume the same endpoint in != ways
consuming != APIs
learn something new!
thanks! @felipesoares6_ felipesoares6 bit.ly/2OYP9IS bit.ly/2zRBNUq client-side server-side