Skip to main content
Back to Dev generators

Dev

Dummy GraphQL Variables Generator

Used by developers, writers, and creators worldwide.

A dummy GraphQL variables generator saves you from hand-crafting JSON payloads every time you need to test a mutation or query. Pick one of five operations — createUser, updateUser, deleteItem, getProduct, or createOrder — set how many objects you need, and get realistic variable JSON instantly. Fields include UUID-format IDs, plausible names and emails, nested arrays, and typed values that mirror what a real API expects. Paste the output into GraphQL Playground's Variables panel, drop it into a Postman or Insomnia request body, or save it as a fixture file for Jest and Vitest. Because the data is structurally accurate per operation, you're testing against payloads that resemble production traffic.

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Select an operation type from the dropdown — createUser, updateUser, deleteItem, getProduct, or createOrder.
  2. Set the count field to how many distinct variable objects you need in a single batch.
  3. Click Generate to produce the JSON output in the results panel below.
  4. Copy one object or the full array, then paste it into the Variables panel of your API client or save it as a test fixture file.

Use Cases

  • Pasting createUser variable JSON into GraphQL Playground to test resolver input validation
  • Saving a batch of 10 createOrder objects as Jest fixtures and iterating with test.each()
  • Populating Postman collection variables for a GraphQL CI pipeline smoke test
  • Supplying realistic updateUser payloads to MSW GraphQL handlers in a React component test
  • Generating deleteItem and getProduct variables to verify ID-format checks in Apollo Server middleware

Tips

  • Generate 5-10 createUser objects at once, then use them as seeds in a beforeAll() block to populate a test database before running query tests.
  • For deleteItem and updateUser operations, copy an ID from a createUser result first so your test chain uses consistent, referentially valid identifiers.
  • Combine multiple operation types in one test file: generate createOrder variables to insert records, then use getProduct variables to verify reads — covering a full CRUD cycle.
  • When documenting an API, generate one object per operation and include them in your README or Notion doc as 'example variables' so consumers can copy-paste immediately.
  • If your resolver enforces strict UUID validation, the generated UUIDs will pass it — but swap in a malformed ID manually in one test case to confirm your error handling fires correctly.
  • Use the batch output with MSW's graphql.mutation handler: map the array into separate handler responses to simulate different server states in Storybook or component tests.

FAQ

how do I use generated GraphQL variables in Postman

Set the request body to raw JSON with two keys: 'query' holding your operation string and 'variables' holding the JSON from this generator. Alternatively, switch Postman to its native GraphQL body mode, which gives you a dedicated Variables field where you can paste the output directly.

why use fake variable data instead of writing id: 1 or test@test.com

Realistic UUIDs and properly formatted fields trigger validation layers — ID format checks, email regex, nested input type guards — that simple placeholder values silently skip. Bugs caught at that layer in testing are bugs that won't reach production.

can I use the generated variables with Apollo Client devtools

Yes. Open Apollo Client devtools in your browser, navigate to the Operations panel, and paste the generated JSON into the variables input before running the mutation or query. It's a fast way to test against your live frontend Apollo instance without building a temporary form.