Augmenting a Legacy REST API with GraphQL
summary
Adds GraphQL on top of a Rails REST API for a coworking app, keeping REST live while letting clients select fields; workflow: write tests, extract business logic into interactors, declare GraphQL types and queries, then reuse the interactors for mutations. Uses GraphQL Ruby, the Altair Chrome extension, and solves N+1 SQL with BatchLoader / DataLoader by providing a reusable preload_field helper that batches association loads. Web frontend adoption is strong, mobile is neutral, no subscriptions used, deployment runs in production but usage is limited by COVID shutdowns.
AI-written summary · about
chapters (7)
related talks
41mThe GraphQL Way: A new path for JSON APIs
24mOptimizing for API Consumers with GraphQL
27mGraphQL on Rails
36mGraphQL on Rails - Creating Living APIs for a Data-hungry World
33mRescuing Legacy Codebases with GraphQL and Rails
54mOptimizing performance in Rails apps with GraphQL layer
35mUsing GraphQL and Relay for hybrid RoR apps
18mIs GraphQL the end of RESTstyle APIs
