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, Front queries made easy
Search
Igor Halfeld
December 01, 2018
Programming
65
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQl, Front queries made easy
How to deal with graphql on client-side
Igor Halfeld
December 01, 2018
More Decks by Igor Halfeld
See All by Igor Halfeld
Modular monoliths with fastify
igorhalfeld
0
210
How to migrate legacy frontend?
igorhalfeld
1
150
Patterns for perfect components in Vue.js
igorhalfeld
0
140
Clean Architecture no Front-end (update 2021-05-11)
igorhalfeld
0
77
Step by step I followed a career in software
igorhalfeld
0
710
Using AI to create memes
igorhalfeld
0
540
Deninho, the TS children
igorhalfeld
1
230
Micro Front-ends, what they don't tell you
igorhalfeld
0
420
CSS in JavaScripto, the anti-pattern that is good
igorhalfeld
1
120
Other Decks in Programming
See All in Programming
パスワード再設定メールのURLについて知っておこう
uyuki234
0
160
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
JIS keyboard support in Omarchy
lef237
0
110
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
ChromeでローカルLLM
ryu1013
0
140
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
170
ActionController meets Protocol Buffers
sorah
0
520
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
220
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Tell your own story through comics
letsgokoyo
1
1.1k
Writing Fast Ruby
sferik
630
63k
The Spectacular Lies of Maps
axbom
PRO
1
1.1k
Product Roadmaps are Hard
iamctodd
55
13k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
800
Rails Girls Zürich Keynote
gr2m
96
14k
Google's AI Overviews - The New Search
badams
0
1.6k
Chasing Engaging Ingredients in Design
codingconduct
0
360
Docker and Python
trallard
47
4.2k
Transcript
GraphQl. Front-end queries made easy.
Igor Halfeld Software Engineer & Consultancy igorluiz.me - @IgorHalfeld
Conheça minha história. Onde tudo começou…
None
Objetivo. Onde eu quero chegar…
None
Vamos contextualizar. Como chegamos até aqui?
ZONA DARK SOAP REST #TRISTEZA #SEMCROSSFIT
"Analisarmos alternativas, como o REST. (…) Ficamos frustrados com as
diferenças entre os dados que queríamos e as requests que eram necessárias para obtê-los.” Lee Byron
2012. GraphQl é criado pelo Facebook apenas para uso interno.
2015. É liberado como open source!
Que rolê é esse?
Duas partes. Consumir no front-end e fazer no back-end. *dar
uma olhada nos conceitos antes.
GraphQl Server Data Sources Clients JSON bonitão lindão GraphQl Queries
Resolvers
None
REST tem vários endpoints em que cada um retorna dados
fixos. GraphQl tem um único endpoint que retorna uma estrutura flexível.
REST GET - /users/:id { “name”: “Igor Halfeld”, “email”: “
[email protected]
”,
“state”: “RJ" } GraphQl POST - /graphql { “data”: { “name”: “Igor Halfeld” } } { query { Users (id: “666") { name } } }
3 pilares. Query, Mutation, Subscription.
REST GET GraphQl POST PUT DELETE Query Mutations
{ query { users { name, email } } }
{ query { users (id: “666”) { name, email } } } GET - /users/:id GET - /users
{ mutation { createUser ( name: "Igor Luiz”, email: “
[email protected]
"
) { name, email } } } CREATE - /users { mutation { updateUser ( name: “Halfeld Igor” ) { name, email } } } PUT - /users/:id
{ mutation { deleteUser (id: “666”) { name, email }
} } DELETE - /users
None
O que muda no front é… Basicamente, saber fazer GraphQl
SDL.
type Users { name: String! email: String! skills: [String]! addresses:
[Address] } type Address { street: String, number: Number } GraphQl SDL (Schema Definition Language)
{ Query { users (id: “666”) { name, height (unit:
METERS) } } } Resolvers <3
{ Query { users { admin (role: ADMIN) { …userFields
} accountants (role: ACCOUNTANT) { …userFields } } } } fragment userFields on User { user, name } Fragments
{ Query { users ($id: ID) { name, email }
} } { id: “666" } Variables
Client de GraphQl. Se é tudo POST, eu posso usar
o axios, certo?
Sim, mas não! Você precisa! Justamente para aproveitar melhor os
benefícios do graphql.
None
Certeza que vai fazer a query de forma certa. Cache
built-it: performance. Consistência na UI: Cache reativo.
None
None
None
Como tamo agora?
None
None
None
Tooling. Ferramental daóra.
None
None
GraphQl faker.
GraphQl Voyager.
DEMO TIME!
bit.ly/demo-floripa
Obrigado! igorluiz.me/talks - @IgorHalfeld