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
Intro to GraphQL
Search
Praveen Durairaj
October 05, 2019
Programming
0
19
Intro to GraphQL
Praveen Durairaj
October 05, 2019
Tweet
Share
More Decks by Praveen Durairaj
See All by Praveen Durairaj
Why GraphQL: A React Developer's Perspective
praveenweb
1
95
Other Decks in Programming
See All in Programming
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
Remix on Hono on Cloudflare Workers
yusukebe
1
300
cmp.Or に感動した
otakakot
3
210
Jakarta EE meets AI
ivargrimstad
0
690
Arm移行タイムアタック
qnighy
0
340
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Better Code Design in PHP
afilina
PRO
0
130
CSC509 Lecture 13
javiergs
PRO
0
110
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.2k
Jakarta EE meets AI
ivargrimstad
0
620
subpath importsで始めるモック生活
10tera
0
320
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Featured
See All Featured
Building Adaptive Systems
keathley
38
2.3k
Code Reviewing Like a Champion
maltzj
520
39k
Side Projects
sachag
452
42k
Site-Speed That Sticks
csswizardry
0
28
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
What's new in Ruby 2.0
geeforr
343
31k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
Embracing the Ebb and Flow
colly
84
4.5k
Teambox: Starting and Learning
jrom
133
8.8k
Transcript
None
Intro to GraphQL - Praveen @praveenweb praveenweb
Query Language • Specification for APIs • Special Syntax •
Backend and Database agnostic • Complex data/nested relationships
Comparing to REST? • Single Endpoint (/graphql) • Schema with
Type System • Introspection • Client side tooling • Caching ?
API Call Attempt Query Params? username Street City username City
Show less data on mobile
None
None
Graph like You want to control the data you get
User: Id Name Address: Street City Orders: Id Product Product: Id Name Photo Brand Brand: Id Name Your API models are “graph” like.
GraphQL Schema: Typesystem of API type User { id: Int
name: String address: Address } type Address { id: Int street: String city: String }
Queries - Fetch data • Type • Operation Name •
Variables • Fields
Mutations • Insert • Update • Delete
Subscriptions • Realtime data • Easy to consume
Server • Define schema • Define resolvers type User {
id: Int name: String address: Address } const resolvers = { Query: { user: () => users, }, };
Query Patterns • Fetch data • Smart client side cache
• Dataloader - Batching
Query Patterns • Fragments • Reusable parts
Mutation Patterns • Insert and update cache • Optimistic update
Subscription Patterns • Polling ? • Live Queries • Notifications
(event based) • Demo
GraphQL = Unified API Layer Databases App GraphQL Server SaaS
APIs Microservices
GraphQL = Unified API Layer • Federation - Apollo •
Remote Joins - Hasura
REST Killer?
REST Killer? • GraphQL enhances REST ◦ Easy to query
◦ Self Documented ◦ Client side performance (less round trips)
GraphQL is evolving @praveenweb praveenweb