# Focus on the Feature, Not the Fixture: GenAI powered GraphQL mocks

DevFeed: [Focus on the Feature, Not the Fixture: GenAI powered GraphQL mocks](<https://devfeed.tech/articles/focus-on-the-feature-not-the-fixture-genai-powered-graphql-mocks-19732.md>)

Original publisher: [Read original article](<https://medium.com/expedia-group-tech/focus-on-the-feature-not-the-fixture-genai-powered-graphql-mocks-ea069670af02?source=rss----38998a53046f---4>)

Author: Samuel Vazquez

Published: 2026-07-31T11:01:02Z

Content type: article

Language: en

Sources: [Expedia](<https://devfeed.tech/sources/expedia.md>)

Topics: [GraphQL](<https://devfeed.tech/topics/graphql.md>), [genai](<https://devfeed.tech/topics/genai.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [API](<https://devfeed.tech/topics/api.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [artificial-intelligence](<https://devfeed.tech/tags/artificial-intelligence.md>), [cli](<https://devfeed.tech/tags/cli.md>), [developer](<https://devfeed.tech/tags/developer.md>), [genai](<https://devfeed.tech/tags/genai.md>), [graphql](<https://devfeed.tech/tags/graphql.md>), [llm](<https://devfeed.tech/tags/llm.md>), [rust](<https://devfeed.tech/tags/rust.md>), [schema](<https://devfeed.tech/tags/schema.md>), [software-engineering](<https://devfeed.tech/tags/software-engineering.md>), [tools](<https://devfeed.tech/tags/tools.md>)

## AI overview

The article presents mockql-rs, a CLI that combines a GraphQL schema, query annotations, hints, and an LLM to generate contextual mock responses. It argues that GraphQL constrains the response shape while the LLM fills only annotated fields, reducing handwritten fixtures and allowing real and mocked fields to coexist.

## Source excerpt

Expedia Group Technology -- EngineeringCombine a GraphQL schema, hints and a LLM to generate contextual GraphQL mock responsesPhoto by Samuel Vazquez somewhere in New Zealand A product developer on our navigation header team spent an afternoon hand-typing a 200-line GraphQL JSON mock response so they could keep building the UI while a resolver was pending to be implemented. The schema changed the next morning. We threw the mock away. That is the boring tax on every GraphQL prototype: mocks that drift, fixtures that rot, frontends blocked on backends, and demos slipping because nobody wanted to update the same mock data again. Mock data is just data. It should not be the most expensive part of trying an idea. GenAI + GraphQL: a match made in heaven Most tools that promise "AI generates an API" share the same flaw: the model invents a shape from scratch, and you spend the afternoon reshaping its output to match your actual types. GraphQL flips that. The selection set is the spec. The schema is the type system. Hand an LLM a query and it already knows the exact JSON it must return, field by field, type by type. That's the unlock: LLMs are bad at inventing shapes and great at filling them in, and GraphQL hands them a bounded shape for free. mockql-rs is what happens when you take that pairing seriously: mark what you want mocked directly in the query with a "@mock" directive: query LoyaltyRewards @mock { loyaltyRewards { heading @mock(hint: "Platinum member") { text } subtitles @mock(hint: "At least 4 items") { text theme } } } Annotate the field, add a hint, keep building. mockql-rs parses the operation, validates it against the schema, and prompts an LLM to fill in only the fields you annotated with "@mock". { "data": { "loyaltyRewards": { "heading": { "text": "Welcome back, Platinum Member" }, "subtitles": [ { "text": "2,450 points until your next reward", "theme": "HIGHLIGHT" }, { "text": "3 nights earned this quarter", "theme": "STANDARD" }, { "text": "Breakfast inc