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
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Stefan Kanev
March 28, 2018
Programming
470
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL
Stefan Kanev
March 28, 2018
More Decks by Stefan Kanev
See All by Stefan Kanev
Въведение в (Machine|Deep) Learning
skanev
0
110
Automated Testing: Getting it Right
skanev
1
100
From Novice to Expert
skanev
0
460
Inbetween Code and Profession
skanev
0
460
Clojure & ClojureScript
skanev
2
140
Extreme Programming
skanev
0
830
За смъртта на TDD
skanev
0
650
Python 0 2014
skanev
1
1.8k
Clojure 0 2014
skanev
0
410
Other Decks in Programming
See All in Programming
Swift愛好会100回記念 第1回を振り返る
jollyjoester
0
120
XHTMLが残したもの
yosuke_furukawa
PRO
1
390
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
210
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
440
業務時間外もAIに働いてもらう話
colorful12
3
9.9k
Press start. Python's next generation.
willingc
PRO
3
300
kubernetes コンポーネント開発入門 / 新卒N年目の勉強会&交流会!〜〇〇への誘い〜 #n_study
mazrean
0
160
Laravelのアプリケーションをどこにデプロイするか #ツナギメオフライン.9
akase244
0
110
Kiroで創り、AgentCoreで繋ぐ!AWSで実践する「AI-DLC」から「AIエージェント統合」までの最新地図
licux
2
300
Building an Out-of-Order CPU
latte72
0
660
Swift愛好会と私(ウホーイ) / Swift Fan Club and Uhooi
uhooi
0
120
Featured
See All Featured
エンジニアに許された特別な時間の終わり
watany
108
250k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
870
Design in an AI World
tapps
1
300
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
190
From π to Pie charts
rasagy
0
350
Become a Pro
speakerdeck
PRO
31
6.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
410
Navigating Weather and Climate Data
rabernat
0
510
Why Our Code Smells
bkeepers
PRO
340
58k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Transcript
GraphQL Stefan Kanev http://skanev.com/ @skanev Slovenia Ruby User Group 28
March 2018 Ljubljana Why is it exciting?
Hi, I’m Stefan
skanev skanev skanev.com about.me/skanev
Chief Technical Officer @
None
Despite the management title, I still tend to think of
myself as a programmer
None
This should be part talk, part Q&A
1 2 3 4 Walkthrough Demonstration Benefits React and Relay
1 Walkthrough
It’s not a technology It’s a standard
queries vs. mutations “gets” data changes stuff
queries vs. mutations “gets” data changes stuff
Queries data on the server is represented as a graph
the client specifies which part of the graph to fetch server returns only those parts the input is in a special language the output is in JSON
None
None
query { hero { name friends { name } }
} Query { "data": { "hero": { "name": "R2-D2", "friends": [ { "name": "Luke Skywalker" }, { "name": "Han Solo" }, { "name": "Leia Organa" } ] } } } Response
Query query { hero { name appearsIn friends { name
appearsIn } } } Response { "data": { "hero": { "name": "R2-D2", "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"], "friends": [ { "name": "Luke Skywalker", "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"] }, { "name": "Han Solo", "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"] }, { "name": "Leia Organa", "appearsIn": ["NEWHOPE", "EMPIRE", "JEDI"] } ] } } }
Schema the graph is composed of objects each object
is of a specific type each type defines a number of fields each field has a type there is a form of polymorphism
type Character { name: String! friends: [Character]! appearsIn: [Episode]! }
type Character { name: String! friends: [Character!]! appearsIn: [Episode!]! } By the way, this… …is better in a different way: Anybody see the difference?
queries vs. mutations “gets” data changes stuff
Mutations each mutation is a separate endpoint it’s RPC-like
(conceptually similar to REST mutations) it still goes through the GraphQL language we’ll see an example later
2 Demonstration
3 Benefits
Caveat emptor It might be a better fit for when
you control the client, as opposed to letting anybody create a client The complexity on the backend is a magnitude bigger
Self-documenting
Decouples clients from backend once the graph is large enough,
clients won’t need to request (as many) endpoints for reading it’s closer to “write once”
Versionless evolution Versioning APIs is a bitch You can
get away with not doing it to a large extent (example)
Traffic optimisation You get only what you asked for
You can get multiple things with a single request
Structure It provides a lot of structure to build 3rd
party tools on (especially in comparison to REST) GraphiQL is a good example Apollo Engine is another one Relay is the most interesting example
4 React and Relay
None
None
?