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
Introduction à GraphQL
Search
fdecampredon
April 07, 2016
Technology
1.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction à GraphQL
JS-Star meetup Paris
http://www.meetup.com/fr-FR/Js-Star/events/229601871/
fdecampredon
April 07, 2016
More Decks by fdecampredon
See All by fdecampredon
Reactive Programming et React
fdecampredon
3
190
Going Reactive with React
fdecampredon
1
570
Introduction à ReactJS
fdecampredon
0
74
Other Decks in Technology
See All in Technology
元・セキュリティ学習経験0大学生による業務紹介 / An Introduction to the Job by a Former College Student with Zero Security Training Experience
nttcom
0
920
組織における AI-DLC 実践
askul
0
150
クレデンシャル流出 ― 攻撃 3 時間 vs 復旧 10 時間。この非対称性にどう備えるか
kazzpapa3
3
620
Zenoh on Zephyr on LiteX
takasehideki
2
130
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
330
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
130
週末にループ・エンジニアリングの理解を深めるためのスライド
nagatsu
0
580
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
4
800
BPaaSで進むAIオペレーションの現在地 AI実装が効く領域とスケーラビリティの選定と実装
kentarofujii
0
210
AIは、人間らしい仕事の夢を見るか?─ AI時代のtoB/toEプロダクトを再設計する
techtekt
PRO
0
160
「ビジネスがわかるエンジニア」とは何か?
ryooob
0
350
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
550
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Code Reviewing Like a Champion
maltzj
528
40k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
How to train your dragon (web standard)
notwaldorf
97
6.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
620
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
170
Marketing to machines
jonoalderson
1
5.5k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.8k
The Invisible Side of Design
smashingmag
301
52k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
350
Building an army of robots
kneath
306
46k
Transcript
Introduction à GraphQL @fdecampredon JS Star Paris - 7/04/2016
Petite histoire de la communication client server
2005: AJAX est né
Au début c’était le chaos
Des milliers de possibilités • Web Services - SOAP •
Remote Object • JSON-RPC • Etc…
Et puis un winner : REST
Pourquoi REST ? • Stateless • Cacheable • « Standard
» • « Facile »
REST est parfait
Vraiment ?
Multiplication des devices = Multiplication des end points
Sur mobile, les vieux clients force à versioner les API
Et plus encore • Complexité à fetcher des objets complexes
sans effectuer de multiples requêtes • Pas de type et impossibilité d’introspection • Etc…
Et le cauchemar commence
Nouveaux problèmes = Nouvelle solution
GraphQL
GraphQL • Un language de Requête de données (et
pas de base données) • On « décrit » nos types de données sous forme d’un Graphe • On définit nos Requêtes sur le client
Comment Utiliser GraphQL
Définition des types sur le serveur
Un type system riche • Des Scalar : Boolean, String,
Int, Float, etc.. • Des « Object Types» • Des interfaces, enum, List, non-null type etc…
On crée ses requêtes sur le client
On récupère uniquement les données nécessaires
Quels sont les avantages ? • Hiérarchique • Centré sur
le Produit • Requêtes spécifiées sur le client • Plus de problèmes de backward compatibility • Type System • Introspection
GraphQL sur le client
Relay
Relay • Créer pour GraphQL • Permet à chaque composant
de définir les données dont il a besoin • Au coeur de la plupart des applications Facebook
Chaque composant définit les données dont il a besoin
On compose les requêtes comme on compose les composants
GraphQL sans Relay
On définit simplement ses requêtes dans ses « services »
Conclusion • REST pose de gros problèmes • GraphQL est
une nouvelle technologie permettant de remplacer REST • A utiliser avec ou sans Relay
François de Campredon @fdecampredon https://github.com/fdecampredon/ Questions ? Relay: https://facebook.github.io/relay/ Graphql:
http://graphql.org/