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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Radoslav Stankov
August 15, 2015
Technology
1.2k
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL
Video:
https://www.youtube.com/watch?v=T2cucknCd6M
Radoslav Stankov
August 15, 2015
More Decks by Radoslav Stankov
See All by Radoslav Stankov
Building LLM Powered Features
rstankov
0
150
Tips for Tailwind CSS
rstankov
0
59
Building LLM Powered Features (lightning talk)
rstankov
0
75
All you need is CSS
rstankov
0
150
Ruby on Rails The Single Engineer Framework
rstankov
0
60
Rails: The Missing Parts
rstankov
1
260
The dream that turned into nightmare
rstankov
0
330
The dream that turned into nightmare (lightning)
rstankov
0
140
Ruby on Rails - The Single Engineer Framework
rstankov
0
360
Other Decks in Technology
See All in Technology
SONiC実機とGNS3 SONiC VSによる事前コンフィグ検証 ― 生成AIエージェントを環境構築・検証支援に使ってみた ―
sonic
0
120
Flow 不死:AI 時代 DevOps 的不變本質
cheng_wei_chen
2
480
從開發到部署全都交給 AI:實作 AI 驅動的自動化流程
appleboy
0
150
フィジカル版Github Onshapeの紹介
shiba_8ro
0
320
千葉での単身赴任からAWSをやり続け、千葉に戻ってきた話
yama3133
1
110
WebGIS AI Agentの紹介
_shimizu
0
540
GitHub Copilot 最新アップデート – 「一歩先」の実践活用術
moulongzhang
5
1.6k
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
180
SteampipeとExcel Power QueryでAWS構成定義書の作成を自動化する
jhashimoto
0
170
[チョークトーク資料]AWS DevOps Agent を使いこなす / AWS Dev Ops Agent Chalk Talk AWS Summit Japan 2026
kinunori
4
760
レガシーな広告配信システムでのAI駆動開発/運用の挑戦
i16fujimoto
0
120
SONiCで構築・運用する生成AI向けパブリッククラウドネットワーク ~実装編~
sonic
0
340
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Accessibility Awareness
sabderemane
1
140
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.6k
HDC tutorial
michielstock
2
720
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
430
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Unsuck your backbone
ammeep
672
58k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Transcript
GraphQL Radoslav Stankov 15/08/2015
Radoslav Stankov @rstankov http://rstankov.com http://blog.rstankov.com http://github.com/rstankov
None
None
None
None
https://github.com/rstankov/it-tour
None
None
None
None
None
GET /api/events/15/sessions { id: 175, start_at: "11:00", title: "GraphQL", speaker_id:
1, track: 2, }
None
None
GET /api/speakers/1 { id: "1", name: "Radoslav Stankov" }
Rest Client Rest Server
Rest Client Rest Server /api/event/15/sessions
Rest Client Rest Server /api/event/15/sessions /api/speakers/{x} (for 13 speakers)
Rest Client Rest Server /api/event/15/sessions /api/speakers/{x} (for 13 speakers)
…approach 2
GET /api/events/15/sessions { id: 175, start_at: "11:00", title: "GraphQL", track:
2, speaker: { id: 1, name: "Radoslav Stankov" } }
None
None
None
None
None
GET /api/events/15/sessions { id: 175, start_at: "11:00", title: "GraphQL", track:
2, speaker: { id: 1, name: "Radoslav Stankov", photo: "/speaker/photo/1/thumb.jpg" } }
…but over time
{ id: 175, start_at: "11:00", title: "GraphQL", track: 2, description:
"... stuff about Rado", speaker: { id: 1, name: "Radoslav Stankov", photo: "/speaker/photo/1/thumb.jpg", big_photo: "/speaker/photo/1/big.jpg", description: "... stuff about Rado", links: [ "http://rstankov.com", "http://blog.rstankov.com", "http://producthunt.com", ], GET /api/events/15/sessions
id: 175, start_at: "11:00", title: "GraphQL", track: 2, description: "...
stuff about Rado", speaker: { id: 1, name: "Radoslav Stankov", photo: "/speaker/photo/1/thumb.jpg", big_photo: "/speaker/photo/1/big.jpg", description: "... stuff about Rado", links: [ "http://rstankov.com", "http://blog.rstankov.com", "http://producthunt.com", ], alabla1: "foo bar", alabla2: "foo bar", alabla3: "foo bar" }, alabla1: "foo bar", alabla2: "foo bar", alabla3: "foo bar" } GET /api/events/15/sessions
None
…approach 3
None
Rest Client Rest Server
Rest Client Rest Server endpoint 1 feature 1
Rest Client Rest Server endpoint 1 feature 1 endpoint 2
feature 2
Rest Client Rest Server endpoint 1 feature 1 endpoint 2
feature 2 endpoint 3 feature 3
Rest Client Rest Server endpoint 1 feature 1 endpoint 2
feature 2 endpoint 3 feature 3 endpoint N feature N
None
None
None
None
{ id: 175, start_at: "11:00", title: "GraphQL", track: 2, speaker:
{ id: 1, name: "Radoslav Stankov", photo: "/speaker/photo/1/thumb.jpg" } }
{ id start_at title track speaker: { id name photo
} }
None
GET /graphql Request Body Response Body
{ event(id: 15) { sessions { id start_at title
track speaker { id name picture } } } } GET /graphql Request Body Response Body
{ event(id: 15) { sessions { id start_at title
track speaker { id name picture } } } } GET /graphql Request Body Response Body
{ event(id: 15) { sessions { id start_at title
track speaker { id name picture } } } } { "data": { "event": { "sessions": [{ "id": 175, "start_at": "11:00", "title": "GraphQL", "track": 2, "speaker": { "id": 1, "name": "Rado", "picture": null } }] } } } GET /graphql Request Body Response Body
It is that simple
https://facebook.github.io/graphql
GraphQL is a query language created by Facebook in 2012
which provides a common interface between the client and the server for data fetching and manipulations. The client asks for various data from the GraphQL server via queries.
Architecture GraphQL Library (Per-Language) Type Definitions Application
Code
GraphQL • Single endpoint • Not just a library •
Application-Layer Protocol • Server agnostic • Strongly-typed • Client-specified queries • Hierarchical
Tries to solve • N+1 API queries • API response
bloat • Documentation • Ad Hoc Endpoints • Structure issues
https://facebook.github.io/react
https://facebook.github.io/relay
None
Query { event(id: 15) { sessions { id start_at
title track speaker { id name picture } } } }
Query { event(id: 15) { sessions { id start_at
title track speaker { id name picture } } } } { "data": { "event": { "sessions": [{ "id": 175, "start_at": "11:00", "title": "GraphQL", "track": 2, "speaker": { "id": 1, "name": "Rado", "picture": null } }] } } }
Mutation mutation RootMutationType { createSpeaker(name: "Rado") { id }
} { "data": { "createSpeaker": { "id": 2 } } }
Documentation { __schema { types { name fields {
name type { name kind ofType { name kind } } } } } } { "data": { "__schema": { "types": [{ "name": "RootQueryType", "fields": [ { "name": "events", "type": { "name": null, "kind": "LIST", "ofType": { "name": "Event", "kind": "OBJECT" } } }, { "name": "event", "type": {
{ id start_at title track speaker: { id name smallPhoto:
photo(size: 100) bigPhoto: photo(size: 400) } } Cool tricks
query withFragments { user(id: 4) { friends(first: 10) { ...friendFields
} mutualFriends(first: 10) { ...friendFields } } } fragment friendFields on User { id name profilePic(size: 50) } Cool tricks
Demo
Issues • New, just a draft specification • No reliable
graphql server libraries, yet • No reliable graphql client libraries, yet • Mutations are weird • Best practices and solutions • Large datasets
None
None
http://jsonapi.org/
{ "links": { "self": "http://example.com/events/15/sessions", "next": "http://example.com/events/15/sessions?page[offset]=2", "last": "http://example.com/events/15/sessions?page[offset]=10" },
"data": [{ "type": "sesssion", "id": "175", "attributes": { "title": "GraphQL", "track": "2", "start_at": "11:00" }, "relationships": { "speaker": { "links": { "self": "http://varnaconf.com/sessions/175/relationships/speaker", "related": "http://varnaconf.com/speaker/1" }, "data": { "type": "speaker", "id": "1" } }, }, "links": { "self": "http://example.com/sessions/175" } }],
"attributes": { "title": "GraphQL", "track": "2", "start_at": "11:00" }, "relationships":
{ "speaker": { "links": { "self": "http://varnaconf.com/sessions/175/relationships/speaker", "related": "http://varnaconf.com/speaker/1" }, "data": { "type": "speaker", "id": "1" } }, }, "links": { "self": "http://example.com/sessions/175" } }], "included": [{ "type": "speaker", "id": "1", "attributes": { "name": "Radoslav Stankov", "picture": "/photos/1/small.jpg", }, "links": { "self": "http://varnaconf.com/speaker/1" } }]
https://speakerdeck.com/rstankov/graphql
https://github.com/rstankov/talks-code
None
None
@rstankov Thanks :)
Questions?