GraphQL Data Mocking at Scale With LLMs and @generateMock
summary
Airbnb integrates an LLM into the Naobi CLI to generate type-safe GraphQL mocks via an @generateMock directive and serve them at runtime with @respondWithMock. The pipeline uses a schema subset, design URLs, an image allowlist and up to three LLM self-heal cycles plus JSON validation to guarantee correctness. Generated patches keep mocks in sync using document and directive hashes, CI gates prevent accidental production use, and teams generate over 2,600 mocks so far.
AI-written summary · about
chapters (9)
- 0:00Introduction and motivation
- 1:23Challenges with GraphQL mocking
- 4:36Solution design and goals
- 6:20Introducing @generateMock directive
- 9:29End-to-end mock generation workflow
- 12:35Unblocking with @respondWithMock
- 15:42Keeping mocks in sync over time
- 18:28Impact and related work
- 20:16Q&A session
related talks
16mHow I Started Mocking My GraphQL Schema
22mA Mock Is a Promise: Making GraphQL Mocks Enforceable
25mSophisticated Schema Mocking
30mIncrease Your Productivity With No Code GraphQL Mocking
38mDeterministic Mocking with GraphQL and Apollo Lunar Launch
33mGraphQL mocking and why it is important for developer productivity.
34mSchema-Driven Testing with Mock Service Worker
18mInteracting with LLMs via GraphQL
