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 in a REST world
Search
Jamie Barton
November 15, 2017
0
170
GraphQL in a REST world
In this talk I gave a short introduction into GraphQL.
Jamie Barton
November 15, 2017
Tweet
Share
More Decks by Jamie Barton
See All by Jamie Barton
The Content Mesh - Berlin
notrab
0
57
The State of GraphQL in 2018
notrab
0
79
React Server Side Rendering with Next.js
notrab
0
170
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.9k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
94
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Scaling GitHub
holman
464
140k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
First, design no harm
axbom
PRO
2
1.1k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
300
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
Transcript
@notrab
@notrab
@notrab Jamie Barton
@notrab @notrab
@notrab Frontend Developer
@notrab @norseal
@notrab Ruby on Rails Sorry @dhh
@notrab Ruby
@notrab jQuery
@notrab jQuery JavaScript* * React, Node, Serverless, Lambda, GraphQL, Apollo
and more
@notrab • React • Redux • Flow • NextJS •
Styled components • Node • GraphQL
@notrab • React • Redux • Flow • NextJS •
Styled components • Node • GraphQL
@notrab
@notrab REST
@notrab Expensive payloads
@notrab
@notrab Over-fetching
@notrab Multiple round trips
@notrab
@notrab Custom endpoints /product_with_categories
@notrab /product_with_categories /mobile/product_with_categories
@notrab Versioning /v2
@notrab
@notrab There has to be a better way
@notrab json:api
@notrab
@notrab …
@notrab Slower development json:api
@notrab Return of custom endpoints json:api
@notrab
@notrab Seriously, there has to be a better way
@notrab March 2017
@notrab
@notrab
@notrab
@notrab
@notrab
@notrab Start thinking in Graphs and not Endpoints
@notrab GraphQL
@notrab GraphQL • Query language for APIs • Built by
Facebook (open sourced in 2015) • Declarative way of querying/fetching data • Works with any database • Typed spec • Support for Go, Ruby, JavaScript & more • Used by companies such as Ticketmaster, GitHub & KLM
@notrab GraphQL is not a database
@notrab GraphQL is not just a React “thing”
@notrab But it’s awesome with React
@notrab ¯\_(ツ)_/¯
@notrab { allProducts { id name amount category { id
name } } } Query
@notrab { "data": { "allProducts": [ { "id": "cj8rkz8dle9r40179cqxt598k", "name":
"iPhone X", "amount": 0, "category": { "id": "cj8t5syc206p30199dbz7a5st", "name": "iPhone" } } ] } } Response
@notrab { "data": { "allProducts": [ { "id": "cj8rkz8dle9r40179cqxt598k", "name":
"iPhone X", "amount": 0, "category": { "id": "cj8t5syc206p30199dbz7a5st", "name": "iPhone" } } ] } } Query Response { allProducts { id name amount category { id name } } }
@notrab No more client-specific endpoints
@notrab
@notrab No more outdated documentation
@notrab
@notrab https://news.ycombinator.com/item?id=15661888
@notrab Put a universal API over your existing backends apollographql.com
@notrab
@notrab There is more to GraphQL
@notrab • Mutations • Subscriptions • Fragments
@notrab • Mutations • Subscriptions • Fragments
@notrab
@notrab
@notrab
@notrab • Mutations • Subscriptions • Fragments
@notrab
@notrab
@notrab
@notrab • Mutations • Subscriptions • Fragments
@notrab
@notrab
@notrab
@notrab
@notrab
@notrab Client Gateway Server Caching Apollo Engine Schema stitching Typical
GraphQL API
@notrab Server side
@notrab graph.cool
@notrab Client side
@notrab graphcool/graphql-request
@notrab
@notrab
@notrab Client side
@notrab
@notrab Demo
@notrab Demo
@notrab
@notrab But what about using GraphQL today?
@notrab Ask your manager for 12 months to migrate to
GraphQL
@notrab Move from monolith to microservices
@notrab Experiment new “feature requests” with GraphQL
@notrab Where to go from here?
@notrab
@notrab Links of interest • https://graphql.com • https://www.howtographql.com • https://graphql.com/tutorials
• https://www.graph.cool/docs/tutorials
@notrab
@notrab