Session description
Producing valid and realistic mock data for prototyping and testing has been an unsolved challenge for years. Mock data is tedious to write and maintain, but attempts to improve the process such as random value generation and field stubbing fall short as they lack essential domain context to make test data realistic and meaningful.
In this talk, I’ll share how we’ve reimagined GraphQL mocking at Airbnb by combining existing GraphQL infrastructure, rich product and schema context, and LLMs to generate convincing, type-safe mock data simply by adding a directive (@generateMock) to a field or operation:
- How integrating LLMs that are highly contextualized by a schema, documentation, and UX design into existing GraphQL tools drives a leap forward in the speed and quality of mock data creation.
- How a directive-driven approach lets engineers generate production-like, schema-conformant mock data without writing code.
- How integrating generated mock data into the GraphQL client runtime can enable engineers to build and test clients before server implementation.
- How this strategy guarantees that generated mock data is correct, deterministic, and stays in-sync with the server schema.