GraphQL
Three Competing Approaches to LLM-Powered GraphQL Mocking Create Fragmentation Risk
Expedia, Airbnb, and a GraphQL RFC propose divergent strategies for generating mock data with AI, each with different design tradeoffs and no clear winner emerging.
InfoQ
Expedia Group recently released mockql-rs, an open-source Rust command-line tool for generating GraphQL mock responses using large language models at query time. The release marks the third public effort in six months to solve the same problem—earlier attempts came from Airbnb in April and a GraphQL Foundation standards proposal in February—but the three projects take fundamentally incompatible approaches.
The Appeal of LLM-Powered Mocking#
The core insight behind all three efforts is that a GraphQL schema already provides the perfect constraint for AI-generated data. Rather than asking models to invent data shapes from scratch (where they tend to falter), developers can supply a bounded schema and let the model fill in plausible values. This inverts the typical weakness of generative tools. The practical benefit is significant: instead of manually writing sprawling JSON fixtures that become stale after the next schema change, developers can generate contextually accurate test data on demand.
Three Divergent Designs#
Expedia's mockql-rs operates as a standalone process sitting between client and server. Developers mark fields with a @mock directive and optional hints, then the tool intercepts requests, validates them against the schema, forwards unmocked fields to the real backend, and merges LLM-generated responses with live data in a single payload. This means a response can contain both production data for ready endpoints and synthetic data for fields still under development—all with no visual distinction between the two sources.
Airbnb's @generateMock directive takes the opposite timing: it runs at build time during code generation, producing both JSON mock files and typed accessor functions. This approach is designed for snapshot tests, demo apps, and unit tests, and intentionally preserves manual edits across regeneration cycles.
The GraphQL Foundation RFC, currently at Stage 0 (strawman status), proposes @mock on operations rather than fields. It requires conforming clients to return mocks without making network requests, stores mock responses in a reserved __graphql_mocks__ directory, and treats LLM generation as a suggested (not mandatory) implementation strategy. The spec also anticipates integration with coding agents, recommending an Agent Skill for conversational mock management.

