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
65
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL & beyond
Felipe Luiz Soares
November 17, 2018
Transcript
73 slides
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
More Decks by Felipe Luiz Soares
See All by Felipe Luiz Soares
Writing unit tests with Jest using test best practices
felipesoares6
0
220
Comecei uma tarefa e olha no que deu!
felipesoares6
0
67
HTML + CSS
felipesoares6
1
170
THE MEANING OF LIFE FRONT-END USER EXPERIENCE AND EVERYTHING
felipesoares6
0
72
BEM
felipesoares6
0
87
Read-Search-Ask
felipesoares6
1
100
Other Decks in Technology
See All in Technology
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
450
ノードが消える前提で設計する!Karpenterで金融システムを止めないためのノウハウ大全
daitak
1
250
業務の傍らで進める改善ループエンジニアリング
bengo4com
1
240
クラウドでも使えるNetApp -現場目線での設計とクラウドバックアップの活用
ryutakondo
1
330
フロントエンドのテストカバレッジは 100%強制がいい
bengo4com
5
2.2k
こんなに変わった! AWSネットワークの常識
shotashiratori
16
11k
IVRy における AI 時代のデータプロダクトと事業開発
ivry_presentationmaterials
0
110
設計手法を「道具」として使いこなすために
a_suenami
7
1.8k
新規事業開発でのAWS活用成功談&失敗談! 〜新規事業開発を専門に行うRelicならではのAWS活用〜
amixedcolor
1
140
認知の質も文化醸成も。数年取り組んで見えてきた技術広報のKPI設計 / Tech PR KPIs: Lessons on Awareness Quality and Culture After Several Years
bitkey
PRO
0
220
「個社」ではなく「業界」の課題を解く AI 対話開発 ー 価値を広げる設計と、価値を守るエンジニアリング ー
ivry_presentationmaterials
4
870
HTTP通信に使おうとすると実はめんどくさいfile_get_contents
maguroalternative
0
260
Featured
See All Featured
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
490
How to Ace a Technical Interview
jacobian
280
24k
Marketing to machines
jonoalderson
1
6k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
[SF Ruby Conf 2025] Rails X
palkan
3
1.6k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.7k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
The Curious Case for Waylosing
cassininazir
1
630
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k