GraphQL Mock Data Generator

Turn a GraphQL schema into example JSON for a root type.

Runs in your browser. Nothing is uploaded — your input is processed on this device and discarded when you close the tab.

GraphQL Mock Data Generator

How to use this tool

  1. Paste a GraphQL schema. Object types, enums and the basic scalar types (String, Int, Float, Boolean, ID) are understood.
  2. Name the root type. Query is the default; use another type name if your schema’s entry point differs.
  3. Generate, then copy. The JSON is placeholder data in the shape of your schema, ready to paste into a test.

Worked example

Paste the sample schema (a Query type with a user field of type User and a count of type Int, plus a User type with id, name, age and active). The output is {"user": {"id": "id-1", "name": "Example name", "age": 42, "active": true}, "count": 42}. Lists produce two example items; a type that refers back to itself stops at a depth of 3 instead of looping forever.

What this tool does not do / Limits

The values are placeholders, not real data: every String is Example plus the field name, every Int is 42, every Float is 3.14 and every Boolean is true. Custom scalar types fall back to a sample string. Arguments on fields are ignored, interfaces are read as plain object types, and directives are not interpreted.

Frequently asked questions

Will the mock data match my real API?

Only in shape, not in values. It is for checking that code handles the structure; replace every value with realistic test data before relying on it.

What happens with a circular type, like a user with friends who are users?

Generation stops re-entering a type already on the current path, and deeper circular fields become null, so the output always finishes.

Related tools