$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GraphQL & beyond
Search
Felipe Luiz Soares
November 17, 2018
Technology
0
57
GraphQL & beyond
Felipe Luiz Soares
November 17, 2018
Tweet
Share
More Decks by Felipe Luiz Soares
See All by Felipe Luiz Soares
Writing unit tests with Jest using test best practices
felipesoares6
0
190
Comecei uma tarefa e olha no que deu!
felipesoares6
0
56
HTML + CSS
felipesoares6
1
140
THE MEANING OF LIFE FRONT-END USER EXPERIENCE AND EVERYTHING
felipesoares6
0
63
BEM
felipesoares6
0
74
Read-Search-Ask
felipesoares6
1
94
Other Decks in Technology
See All in Technology
AI時代の新規LLMプロダクト開発: Findy Insightsを3ヶ月で立ち上げた舞台裏と振り返り
dakuon
0
200
regrowth_tokyo_2025_securityagent
hiashisan
0
250
re:Invent 2025 ~何をする者であり、どこへいくのか~
tetutetu214
0
220
AI時代のワークフロー設計〜Durable Functions / Step Functions / Strands Agents を添えて〜
yakumo
1
190
Database イノベーショントークを振り返る/reinvent-2025-database-innovation-talk-recap
emiki
0
230
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
180
AI 駆動開発勉強会 フロントエンド支部 #1 w/あずもば
1ftseabass
PRO
0
400
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
410
Fashion×AI「似合う」を届けるためのWEARのAI戦略
zozotech
PRO
2
840
打 造 A I 驅 動 的 G i t H u b ⾃ 動 化 ⼯ 作 流 程
appleboy
0
360
評価駆動開発で不確実性を制御する - MLflow 3が支えるエージェント開発
databricksjapan
1
210
Oracle Cloud Infrastructure IaaS 新機能アップデート 2025/09 - 2025/11
oracle4engineer
PRO
0
160
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
66k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Code Review Best Practice
trishagee
74
19k
BBQ
matthewcrist
89
9.9k
Navigating Team Friction
lara
191
16k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.3k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
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