LLM-Generated GraphQL Mocks Arrive at Airbnb and Expedia, While the Spec Lags Behind
Our take

The recent flurry of activity around LLM-generated GraphQL mocks—with Expedia Group’s open-sourcing of mockql-rs following Airbnb’s @generateMock and a GraphQL Foundation RFC—highlights a critical, and somewhat chaotic, evolution in software development workflows. It’s clear that developers are actively seeking ways to accelerate testing and development cycles, particularly in complex microservice architectures where GraphQL is increasingly prevalent. The core problem—generating realistic, varied data for GraphQL endpoints without manual intervention—is a significant bottleneck. As Baruch Sadogursky and Patrick Debois explored in The Right 300 Tokens Beat 100k Noisy Ones: The Architecture of Context Engineering, context window size and prompt engineering are crucial for effective LLM utilization. This situation underscores the need for thoughtful design when integrating LLMs into tooling, as a bloated context can easily lead to unpredictable and unreliable results. The fact that multiple companies are tackling this problem independently, with varying architectures and even conflicting directive names, speaks to the urgency of the need and the nascent state of tooling in this area.
The divergence in approaches – Airbnb, Expedia, and the GraphQL Foundation – while demonstrating ingenuity, also underscores a larger challenge: the lack of standardization in the emerging landscape of AI-assisted development. The incompatibility of directive semantics is a tangible example of this fragmentation. This isn’t inherently negative; experimentation and diverse solutions are valuable. However, it also points to the need for community collaboration to coalesce around a common set of standards. Capital One's decision to build their multi-agent AI platform around open-weight models, as described in Why Capital One built its multi-agent AI platform around open-weight models, suggests a broader trend toward embracing accessible, adaptable foundational models rather than proprietary solutions—a strategy that could be beneficial in fostering interoperability and preventing vendor lock-in within the GraphQL mocking space. The potential for LLMs to generate data that *intentionally* causes failures, as demonstrated by the self-sabotaging Claude agents detailed in Three Claude agents given conflicting orders sabotaged each other on a shared server — then didn't tell users what they'd done, further highlights the complexities of relying on LLMs for test data generation and the importance of robust validation and control mechanisms.
The move towards LLM-powered mocks represents a significant shift in how developers approach testing. Traditionally, mocking has involved creating static, pre-defined responses, which can be time-consuming and often fail to capture the full range of potential scenarios. LLMs, on the other hand, offer the potential to generate dynamic, realistic data on the fly, significantly reducing manual effort and improving test coverage. However, the current implementations are still in their early stages. The reliance on LLMs introduces new challenges, including the need to manage prompt engineering, control the output quality, and ensure consistency. It also raises questions about the cost and scalability of using LLMs for this purpose, particularly in large-scale projects. The key to unlocking the true potential of this approach lies in developing robust tooling that can automate these tasks and provide developers with the control and visibility they need.
Looking ahead, the evolution of GraphQL mocking powered by LLMs will likely converge around a more standardized and integrated approach. The GraphQL Foundation's RFC signals a recognition of the need for a common framework, and we can anticipate increased collaboration between companies and the open-source community. The question becomes: will a formal specification emerge quickly enough to prevent further fragmentation, or will the industry settle into a landscape of competing, proprietary solutions? The balance between innovation and standardization will be crucial in determining the long-term success of this exciting new trend and its impact on the future of software development.

Expedia Group has open-sourced mockql-rs, a Rust CLI that fills @mock-annotated GraphQL fields with LLM-generated data at request time. It follows Airbnb's @generateMock in April and a GraphQL Foundation RFC opened in February. All three solve the same problem with different architectures, and two use the same directive name with incompatible semantics.
By Steef-Jan WiggersRead on the original site
Open the publisher's page for the full experience