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
Exploring GraphQL
Search
Marc-Andre Giroux
March 09, 2017
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Exploring GraphQL
Marc-Andre Giroux
March 09, 2017
More Decks by Marc-Andre Giroux
See All by Marc-Andre Giroux
It Depends - Examining GraphQL Myths & Assumptions
xuorig
0
140
So you Want to Distribute your GraphQL Schema?
xuorig
4
880
So you Want to Distribute your GraphQL Schema?
xuorig
0
690
GraphQL Schema Design @ Scale
xuorig
5
2.2k
Continuous Evolution of GraphQL Schemas @ GitHub
xuorig
3
2.2k
GraphQL à Shopify
xuorig
0
290
GraphQL @ Shopify
xuorig
6
1.8k
GraphQL on Rails
xuorig
2
400
From REST to GraphQL
xuorig
9
1.3k
Other Decks in Programming
See All in Programming
技術記事、 専門家としてのプログラマ、 言語化
mizchi
14
7.5k
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
180
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1.2k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
420
Apache Hive: Toward a Cloud Native Lakehouse
okumin
0
150
フィードバックで育てるAI開発
kotaminato
1
120
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
350
共通化で考えるべきは、実装より公開する型だった
codeegg
0
260
Haskell/Servantを通してWebミドルウェアを捉え直す
pizzacat83
1
600
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
2.9k
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
140
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
67
56k
Music & Morning Musume
bryan
47
7.3k
Abbi's Birthday
coloredviolet
3
8.7k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
150
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Tell your own story through comics
letsgokoyo
1
1k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Building Flexible Design Systems
yeseniaperezcruz
330
40k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Transcript
Exploring GraphQL Marc-André Giroux @__xuorig__
None
None
None
@__xuorig__ REST APIs are Great.
@__xuorig__ Except when they're not.
@__xuorig__ Multiple round-trips are not ideal.
@__xuorig__ GET /people/1 GET /planet/2 GET /film/3
@__xuorig__ SELECT * FROM /ENDPOINT
@__xuorig__ GET /people/1 { "person": { "name": "luke" } }
@__xuorig__ { "name": "Luke Skywalker", "height": "172", "mass": "77", "hair_color":
"blond", "skin_color": "fair", "eye_color": "blue", "birth_year": "19BBY", "gender": "male", "homeworld": "http://swapi.co/api/ planets/1/", "films": [ "http://swapi.co/api/films/6/", "http://swapi.co/api/films/3/", "http://swapi.co/api/films/2/", "http://swapi.co/api/films/1/", "http://swapi.co/api/films/7/" ],
@__xuorig__ What do clients even use?
@__xuorig__ { "name": "Luke Skywalker", "height": "172", "mass": "77", "hair_color":
"blond", "skin_color": "fair", "eye_color": "blue", "birth_year": "19BBY", "gender": "male", "homeworld": "http://swapi.co/api/ planets/1/", "films": [ "http://swapi.co/api/films/6/", "http://swapi.co/api/films/3/", "http://swapi.co/api/films/2/", "http://swapi.co/api/films/1/", "http://swapi.co/api/films/7/" ],
GraphQL
@__xuorig__ A special type of database.
@__xuorig__ A library.
@__xuorig__ A Query Langage.
@__xuorig__ &
@__xuorig__ A Spec for servers to execute GraphQL Queries.
@__xuorig__ A GraphQL Hello World.
@__xuorig__ query { film { title } }
@__xuorig__ Anatomy of a GraphQL Query
@__xuorig__ query MyQuery { film { title } }
@__xuorig__ query MyQuery { film { title } } Operation
Type
@__xuorig__ query MyQuery { film { title } } Operation
Name
@__xuorig__ query MyQuery { film { title } } Selection
Set
@__xuorig__ query MyQuery { film { title } } Field
@__xuorig__ • Lexed • Parsed • Validated • Executed
@__xuorig__ "data": { "film": { "title": "A New Hope" }
}
@__xuorig__ query { film(id: "123") { title } }
@__xuorig__ query { film(id: "123") { title characters { name
} } }
@__xuorig__ "data": { "film": { "title": "A New Hope", "characters":
[ { "name": "Luke Skywalker" }, { "name": "Princess Leia" } ] } }
@__xuorig__ The Type System.
@__xuorig__ { film(id: "123") { title characters { name }
} }
@__xuorig__ { film(id: "123") { title characters { name }
} } type QueryRoot { film(id: ID!): Film }
@__xuorig__ { film(id: "123") { title characters { name }
} } type Film { title: String! characters: [Character!]! }
@__xuorig__ { film(id: "123") { title characters { name }
} } type Character { name: String! }
@__xuorig__ Introspection.
@__xuorig__ { __schema { types { name } } }
@__xuorig__ { __type(name: "Film") { name description } }
@__xuorig__ Introspection == Clients with Super Powers
@__xuorig__ • AutoComplete • Client side validation • IDE Integration
• Code Generation
@__xuorig__ GraphiQL
@__xuorig__
@__xuorig__ swapi-graphql-ruby.herokuapp.com
Mutations
@__xuorig__ mutation { addFilm(name: "StarWars 8") { title } }
Fragments
@__xuorig__ query { film(id: "123") { title characters { name
} } bestRatedfilm { title characters { name } } }
@__xuorig__ query { film(id: "123") { title characters { name
} } bestRatedfilm { title characters { name } } }
@__xuorig__ fragment filmFragment on Film { title characters { name
} }
@__xuorig__ query { film(id: "123") { ...filmFragment } bestRatedfilm {
...filmFragment } } fragment filmFragment on Film { title characters { name } }
@__xuorig__ Versioning
@__xuorig__ Versioning Continuous Evolution
@__xuorig__ What about Security ?
@__xuorig__ • Maximum Depth • Query Complexity • Timeout
@__xuorig__ My HTTP Caching :( !
@__xuorig__ • Client Side Cache • Persisted Queries
@__xuorig__ GraphQL is Great.
@__xuorig__ A single roundtrip to fetch exactly what a client
needs.
@__xuorig__ Declarative and predictable. (no more SELECT *)
@__xuorig__ Servers express possibilities.
@__xuorig__ Clients define requirements.
@__xuorig__ That's real separation of concerns!
@__xuorig__ Great developer experience.
@__xuorig__ It makes us ship faster.
@__xuorig__ An everyone is happy.
Thank you! Marc-André Giroux @__xuorig__