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
140
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
26
The State of GraphQL in 2018
notrab
0
68
React Server Side Rendering with Next.js
notrab
0
140
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
2
3.4k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
Building Adaptive Systems
keathley
31
1.9k
Web Components: a chance to create the future
zenorocha
305
41k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
274
13k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Become a Pro
speakerdeck
PRO
11
4.5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
226
51k
Into the Great Unknown - MozCon
thekraken
10
990
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