GraphQL on Rails
summary
Shows how GraphQL replaces many REST endpoints by requesting exact data shapes and keeps controller code tiny, using the graphql-ruby gem on Rails and client caches like Apollo/Relay for normalization. Describes a concrete N+1 problem and a working solution: graphql-batch loaders that batch DB fetches to eliminate per-item queries. Covers POSTing large queries, client-side normalized caching to restore cacheability, and guards (timeouts, max depth, complexity) that prevent malicious queries.
AI-written summary · about
chapters (39)
- 0:00Intro
- 0:38Welcome
- 1:40UI Component
- 2:22Resources
- 4:08Custom Endpoint
- 5:13Reusable Endpoint
- 6:47Hello World example
- 7:42Name example
- 8:05Shop example
- 8:43Object types
- 9:20GraphQL type system
- 10:23Validation
- 10:48GraphQL Schema
- 11:55Graphical Schema Explorer
- 12:52Fragments
- 13:08Component fragments
- 13:41Mutations
- 14:13Graphical Ruby
- 14:54Field Name
- 15:30args
- 15:41schema
- 15:58query length
- 16:10controller
- 16:25query string
- 16:51GraphQL isnt a silver bullet
- 17:25Image queries
- 18:22HTTP Cache
- 18:53Normalized Cache
- 19:25Clientside Cache
- 19:45Clientside Caches
- 20:36Security
- 22:10Subscriptions
- 22:47Realtime Updates
- 23:11GraphQL defer
- 23:50Clientserver relationship
- 24:43Data shape
- 25:02Efficiency
- 25:13predictability
- 25:30GraphQL API
related talks
41mThe GraphQL Way: A new path for JSON APIs
29mFrom REST to GraphQL
36mGraphQL on Rails - Creating Living APIs for a Data-hungry World
54mOptimizing performance in Rails apps with GraphQL layer
27mGraphQL and Rails beyond HTTP APIs
38mNew HotN+1ness -Hard lessons migrating from REST to GraphQL
24mOptimizing for API Consumers with GraphQL
23mAugmenting a Legacy REST API with GraphQL
