Senior Track Roadmap

GraphQL vs REST strategy

This course weighs GraphQL against REST for Rails teams. It starts from the client inventory that decides the question: several heterogeneous clients you don't control or can't deploy with the server. It covers what GraphQL solves, namely over-fetching, under-fetching and one round trip for a whole graph. It then covers what it costs: N+1 by default, lost HTTP caching, unbounded query cost, field-level authorization and errors returned with 200. It also covers what REST provides for free, middle-ground options, graphql-ruby in a Rails application and a four-question decision framework.

What you'll learn

  • ✓The client condition under which GraphQL is worth its cost
  • ✓The costs of GraphQL: N+1, lost HTTP caching, query limits and errors with 200
  • ✓What REST provides through URLs, logs, one authorization gate and path versioning
  • ✓Middle-ground options: sparse fieldsets, composite endpoints and a backend-for-frontend
  • ✓How graphql-ruby, Dataloader, complexity limits and trusted documents fit in Rails
  • ✓A four-question framework for deciding and for saying no
Free preview · Lesson 1 4 min read

The question behind GraphQL vs REST

Someone in a planning meeting says "we should move to GraphQL". Nobody in the room wants to be the person who says no to a newer thing, so the team spends a quarter on it. Eighteen months later, there are two ways to read a Course out of the same table, and neither can be deleted.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...