Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
150
THE MEANING OF LIFE FRONT-END USER EXPERIENCE AND EVERYTHING
felipesoares6
0
64
BEM
felipesoares6
0
74
Read-Search-Ask
felipesoares6
1
94
Other Decks in Technology
See All in Technology
SREじゃなかった僕らがenablingを通じて「SRE実践者」になるまでのリアル / SRE Kaigi 2026
aeonpeople
6
2.4k
制約が導く迷わない設計 〜 信頼性と運用性を両立するマイナンバー管理システムの実践 〜
bwkw
3
940
SREチームをどう作り、どう育てるか ― Findy横断SREのマネジメント
rvirus0817
0
280
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
240
Frontier Agents (Kiro autonomous agent / AWS Security Agent / AWS DevOps Agent) の紹介
msysh
3
170
Digitization部 紹介資料
sansan33
PRO
1
6.8k
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
Agile Leadership Summit Keynote 2026
m_seki
1
620
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
120
StrandsとNeptuneを使ってナレッジグラフを構築する
yakumo
1
120
AI駆動開発を事業のコアに置く
tasukuonizawa
1
200
Context Engineeringの取り組み
nutslove
0
350
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Thoughts on Productivity
jonyablonski
74
5k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
320
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
230
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
3.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
New Earth Scene 8
popppiees
1
1.5k
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