Mock GraphQL Response Generator
Generate realistic mock GraphQL responses from a pasted SDL schema and optional query. Type-aware mock generation with Faker-mapped scalars (String/Int/Float/Boolean/ID/Date/Email/URL/UUID/JSON), list sizing, enums, unions/interfaces with __typename resolution, fragments & aliases, per-field overrides, nullable/error-state injection, MSW/Apollo resolver snippet export. 100% client-side, no schema upload.
About Mock GraphQL Response Generator
Generate realistic mock GraphQL responses from a pasted SDL schema and optional query. Type-aware mock generation with Faker-mapped scalars (String/Int/Float/Boolean/ID/Date/Email/URL/UUID/JSON), list sizing, enums, unions/interfaces with __typename resolution, fragments & aliases, per-field overrides, nullable/error-state injection, MSW/Apollo resolver snippet export. 100% client-side, no schema upload. Everything runs locally in your browser — your data never leaves your device.
How to use
- Enter your input in the tool above.
- Adjust any options to your preference.
- Use the Copy or Download buttons to save the result.
- Everything happens locally — your data never leaves your browser.
FAQ
How does the Mock GraphQL Response Generator work?
Paste a GraphQL SDL schema (type User { id: ID! name: String! ... }, unions, interfaces, enums, custom scalars) and optionally a query (mutation/subscription). The tool parses the SDL into an in-memory type map, walks the query selection set, and produces a realistic mock JSON response shaped exactly to the query — with type-aware Faker values (emails, URLs, UUIDs, dates, numbers, etc.), configurable list sizes, custom per-field overrides, and __typename resolution for unions and interfaces.
Which GraphQL features are supported?
SDL: type, interface, union, enum, input, scalar, custom scalars, field arguments, list types ([Type!]!), non-null modifiers (!). Query: Query/Mutation/Subscription operations, field selections, nested objects, fragments (inline + named), aliases, list fields with custom sizes, __typename. Recursion is capped at a configurable depth (default 3) to prevent infinite loops on self-referential types like User.friends: [User!]!.
Can I override the mock value for specific fields?
Yes. The per-field overrides panel lets you set a literal value or a Faker-style template ({{name.firstName}}, {{internet.email}}, {{datatype.uuid}}, etc.) for any field path. Overrides take precedence over the type-aware default. Common custom scalars (Date, Email, URL, UUID, DateTime, JSON, BigInt, Decimal) are auto-mapped to realistic Faker values.
Are my schemas or queries uploaded anywhere?
No. SDL parsing and mock generation run entirely in your browser. Nothing is sent to a server. History (last 20 generations) is stored in localStorage on this device only — metadata only, never the schema or query text — and the shareable URL encodes options in the fragment (after #) which browsers never transmit.
What extras does this tool offer versus @graphql-tools/mock and Apollo mocking?
(1) Pure browser tool — no code or server required. (2) SDL parser supporting type/interface/union/enum/input/scalar/custom-scalar with non-null & list modifiers. (3) Query parser supporting selection sets, nested fields, fragments (inline + named), aliases, and __typename. (4) Type-aware Faker mapping for 12+ built-in + custom scalars. (5) Configurable list sizes (default, per-field override). (6) Recursion depth cap (default 3) with smart cycle-break. (7) Per-field overrides (literal or Faker template). (8) Nullable/error-state injection (random nulls, partial errors, full errors). (9) Seedable mulberry32 PRNG for reproducibility. (10) Union/interface __typename resolution. (11) MSW handler snippet export. (12) Apollo mock resolver snippet export. (13) Multiple operation detection (queries, mutations, subscriptions). (14) JSON / GraphQL-response / MSW / Apollo export formats. (15) localStorage history (max 20). (16) Shareable-URL config. (17) Copy / download. (18) Live preview with syntax highlighting.
Related tools
.bashrc / .zshrc Alias & Config Manager
Build shell aliases, functions, exports, and PATH edits in a visual editor, then export a clean, commented .aliases file sourced from both .bashrc and .zshrc — with shadowing detection against shell builtins and common CLI tools, function suggestions when args are needed, starter packs (git, docker, kubectl, navigation, safety, ls, dev, devops, data science), import of existing rc files, dedupe, history (localStorage), and shareable URL. 100% client-side.
Add / Subtract Date Calculator
Add or subtract years, months, weeks, days, hours, minutes and seconds from a starting date/time. Calendar-day or business-day mode with custom weekend + holiday list. Month-end policy toggle (clamp to last day vs overflow). Repeat/series mode (e.g. every 2 weeks x 10) with CSV export. Shareable URL. 100% client-side.
Age Calculator
Calculate exact age from a birth date in calendar years/months/days (no negative-day bugs) plus totals in months/weeks/days/hours/minutes/seconds. Next-birthday countdown with weekday. Feb-29 birthday policy toggle. Milestones (1,000 days, 10,000 days, 1 billion seconds). Zodiac sign + Chinese zodiac. Age gap comparison. Shareable URL. 100% client-side.