Gatsby eats APIs

Gatsby eats APIs@spences10

👋

first time

Scott Spence

est. 2018

Warning!

Excessive use

of GIFs

Memes and Emoji

Sorry

not sorry

How about that GraphQL stuff?

Gatsby eats APIs@spences10

Poll 💈

Gatsby eats APIs@spences10

History lesson

(quick)
Gatsby eats APIs@spences10

What's GraphQL? 🤔

Gatsby eats APIs@spences10

It's not

Gatsby eats APIs@spences10

A library or a framework.

Gatsby eats APIs@spences10

A database technology.

Gatsby eats APIs@spences10

It is

Gatsby eats APIs@spences10

A query language.

Gatsby eats APIs@spences10

For querying APIs.

Gatsby eats APIs@spences10

A single endpoint for your data

Gatsby eats APIs@spences10

Named terribly

Gatsby eats APIs@spences10

A great way to see the shape of your data

Gatsby eats APIs@spences10
  • REST API
  • Multiple Endpoints (GET /users, POST /product, ...)
  • JSON Data is Exchanged
  • Any Server-side Language, any frontend framework
  • Stateless
  • GraphQL API
  • One Endpoint Only (POST /graphql)
  • JSON Data is Exchanged
  • Any Server-side Language, any frontend framework
  • Stateless

Example

Gatsby eats APIs@spences10
Gatsby eats APIs@spences10

Imagine your REST API is a vending machine

You select data parts individually and collect.

Gatsby eats APIs@spences10
Gatsby eats APIs@spences10

With GraphQL it's like enabling shopping basket

so you can get everything in one go

Gatsby eats APIs@spences10

Why Gatsby? 🤔

Gatsby eats APIs@spences10

Speed

🏎

Gatsby eats APIs@spences10

Perf

Gatsby eats APIs@spences10

People want things fast

Gatsby eats APIs@spences10
google logo

Since 2010

Gatsby eats APIs@spences10

How users interact with your site

could impact rankings

Gatsby eats APIs@spences10

Click through rates

Gatsby eats APIs@spences10

Time spent on page

Gatsby eats APIs@spences10

Return rate

Gatsby eats APIs@spences10

Bounce Rate & Conversions

where it really matters

💷 💳 💸 🤑

Gatsby eats APIs@spences10

How fast is fast enough?

Gatsby eats APIs@spences10

2 seconds ⏱

Gatsby eats APIs@spences10
https://www.thinkwithgoogle.com/marketing-resources/data-measurement/mobile-page-speed-new-industry-benchmarks/
Gatsby eats APIs@spences10

FAST

Gatsby eats APIs@spences10

BLAZING FAST 🚀

Gatsby eats APIs@spences10

Gatsby 💜's GraphQL

Gatsby eats APIs@spences10

GraphQL layer built in

Gatsby eats APIs@spences10

There are three main ways to get data into a Gatsby site.

Gatsby eats APIs@spences10

Build time

yarn gatsby build
Gatsby eats APIs@spences10

At build time outside of the data layer, using unstructured data.

Gatsby eats APIs@spences10

At build time outside of the data layer, using unstructured data.

Gatsby eats APIs@spences10

At run time, fetching from the client.

Gatsby eats APIs@spences10

🧐

Gatsby eats APIs@spences10

Slides

ss10.dev/GatsbyEatsAPIs

Icons made by photo3idea_studio from www.flaticon.com
Gatsby eats APIs@spences10
scott face

ss10.dev/git

Gatsby eats APIs@spences10