Urgent.News

What's breaking now, across thousands of outlets.

Tech

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

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 Wiggers

Three companies, Airbnb, Expedia, and the GraphQL Foundation, have recently explored generating GraphQL mock responses using Large Language Models (LLMs). Each company took a distinct approach, leading to three separate implementations with differing designs and implementations. Expedia open-sourced mockql-rs, a Rust CLI that creates GraphQL mock responses at runtime, while Airbnb introduced @generateMock at build time and the RFC proposes using @mock at the operation level.

Despite their differences, all three approaches aim to leverage the strengths of LLMs, which excel at completing existing data structures but struggle with inventing new ones. The primary use case is to provide developers with generated data for fields where backend resolvers are not yet implemented. However, the mock responses can carry equal weight in the final payload, making it challenging for clients to differentiate between real and generated data.

The lack of standardization across the three implementations raises questions about which approach will ultimately become the de facto standard for GraphQL mock generation.

Written by urgent.news from InfoQ's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at infoq.com →

More in Tech

More from Friday 14 August →