← All guides

A graphql-faker alternative with deterministic data and mutations that persist

Credit where due: graphql-faker is a classic β€” 2,700+ GitHub stars, from the APIs-guru team behind GraphQL Voyager. Its core idea is genuinely elegant: write any GraphQL SDL, sprinkle @fake(type: productName) and @examples directives on the fields, and get a running mock with an interactive editor and a Voyager schema map. Its --extend mode β€” proxy a real GraphQL API and fake only the fields you're proposing to add β€” is still one of the best schema-prototyping ideas anyone has shipped.

But if you're on this page, you've probably hit one of two things: the install that doesn't work, or the mock that won't hold still. Both are real. We verified everything below ourselves in August 2026.

First, the elephant: the latest release ships no code

graphql-faker's last release β€” 2.0.0, tagged latest on npm since August 14, 2023 (the same day as the repo's last commit) β€” is broken in an unusually complete way: the published tarball contains no JavaScript at all. We downloaded it and listed the contents: Dockerfile, LICENSE, README.md, package.json. That's the whole package. Its bin entry points at dist/index.js, which doesn't exist, so after npm install graphql-faker succeeds there is simply no graphql-faker executable in node_modules/.bin.

It gets worse before it gets better: on a default npm setup, npm install graphql-faker often doesn't even finish β€” the resolver hangs at the idealTree stage backtracking through the old dependency range (we watched it spin at full CPU for 5+ minutes, twice; the repo's open issue #196 "Cannot install graphql-faker" describes the same stall). The repo also has an open issue from February 2024 titled, verbatim, "Any alternatives to this package?" Meanwhile the package still gets 3,557 downloads a week (Aug 18–24, 2026) β€” thousands of installs of a mock server with no server in it.

The honest first answer if you want to stay on graphql-faker: install a version that contains code, and skip the resolver hang:

# the last releases that actually ship dist/ :
npm install graphql-faker@2.0.0-rc.25 --legacy-peer-deps   # last 2.x with code
# or
npm install graphql-faker@1.9.2 --legacy-peer-deps          # last stable 1.x

The walls (verified on 2.0.0-rc.25, the newest release with code)

We ran it with a small SDL β€” a Product type with @fake/@examples directives, a products(limit: Int) query, and createProduct/deleteProduct mutations. Every claim below is observed behavior.

Wall 1: every request invents new data. The same { products { id title } } query returned a completely different set of products each time β€” different ids, titles, prices, even a different number of items. Fine for eyeballing a UI; hopeless for tests. You can't assert on anything, snapshot anything, or reproduce anything.

Wall 2: arguments are decoration. products(limit: 2) returned lists of length 2, 2, 4, 4, 2, 4 across six calls β€” the argument is part of the schema, not the behavior. Pagination, filtering and sorting simply don't exist.

Wall 3: you can never test the not-found path. product(id: "does-not-exist") cheerfully returned a fake product. No input reaches a null β€” the code path where half of real-world GraphQL bugs live is unreachable.

Wall 4: mutations are theater β€” convincing theater. createProduct(title: "Dyson V15", price: 599) echoed our arguments back in a plausible response object… and persisted nothing: the very next query returned fresh random products with no Dyson in sight. deleteProduct returned a coin-flip boolean. A createβ†’read-back test cannot pass against it.

Wall 5: it's a localhost process. The mock lives on your machine. A teammate, a deployed preview, CI, or your phone can't reach it without you running and babysitting a server somewhere. (It also pins graphql@14.7.0, from 2020, into your tree.)

The 60-second switch

Mockbird works from the other end: instead of a hand-written SDL, you define resources (or one-click a preset) and get a typed GraphQL endpoint and a REST API over the same live data β€” queries, relations, and mutations that really write:

curl -X POST https://mockbird.mockbird.workers.dev/api/projects \
  -H 'content-type: application/json' -d '{"name":"my-api","preset":"ecommerce"}'
# β†’ {"id":"…","adminKey":"…","baseUrl":"https://mockbird.mockbird.workers.dev/m/…"}
# GraphQL endpoint: <baseUrl>/graphql   (open it in a browser β†’ embedded GraphiQL)

This transcript ran against the shared demo project before publishing β€” the exact behaviors graphql-faker can't do:

# deterministic: same query, same data, every time β€” and limit means limit
curl https://mockbird.mockbird.workers.dev/m/demo/graphql \
  -H 'content-type: application/json' \
  -d '{"query":"{ products(limit: 2) { id name price } }"}'
# β†’ ids 1 and 2, same records on every call

# the not-found path exists:
#   { product(id: 99999) { id } }        β†’ {"data":{"product":null}}

# mutations persist:
#   mutation { createProduct(input: { name: \"Dyson V15\", price: 599 }) { id } }
#   β†’ id 31 … and { product(id: 31) } returns it, REST GET /products/31 returns it,
#   mutation { deleteProduct(id: 31) } β†’ true, then product(id: 31) β†’ null

Data is seeded faker-style at create time (realistic names, prices, emails β€” 30+ field types, no LLM involved) and then it behaves like a database, because it is one.

graphql-faker concepts β†’ Mockbird

graphql-fakerMockbirdNotes
SDL file + @fake directivesresources with typed fieldsschema is generated for you β€” docs; import an OpenAPI spec or db.json to skip even that
random data every requestseeded, persistent recordsdeterministic β€” assert, snapshot, reproduce
products(limit:) ignoredlimit/page/sortBy/order/q/where honoredtyped where filter input per resource
mutations echo args, persist nothingcreate/update/delete write to the storeREST and GraphQL see the same data; webhooks fire
interactive editorembedded GraphiQLGET the /graphql URL in a browser
localhost:9002hosted URLshareable with teammates, CI, deployed previews β€” 10,000 req/project/day free
fixed fake data β‰  scenariossnapshot pinningsave named data states; pin one per request with X-Mockbird-Snapshot β€” parallel test workers, zero races
no failure simulation?mock_delay, ?mock_chaosworks on the GraphQL endpoint too (measured 2.1 s with mock_delay=2000)
--extend real-API proxy modeno equivalenthonest: graphql-faker's best idea, and we don't have it

Try it in 10 seconds (shared demo, no setup)

# GraphiQL in your browser:
#   https://mockbird.mockbird.workers.dev/m/demo/graphql

curl https://mockbird.mockbird.workers.dev/m/demo/graphql \
  -H 'content-type: application/json' \
  -d '{"query":"{ products(sortBy: \"price\", order: \"desc\", limit: 2) { id name price } }"}'

# same data over REST β€” one store, two protocols:
curl 'https://mockbird.mockbird.workers.dev/m/demo/products?sortBy=price&order=desc&limit=2'

Honest comparison

graphql-fakerMockbird
Pricefree, open source (MIT)free while in beta
Schema sourceany hand-written SDL β€” unions, interfaces, arbitrary nestinggenerated from resources (flat-ish types + relations); no SDL import
Data across requestsrandom every timedeterministic, persistent
Arguments (limit/filter/sort)ignoredhonored, incl. typed where
Mutationsecho args, persist nothingreally write; visible over REST too
Not-found path testableno β€” every id resolves to fake datayes β€” missing id β†’ null
Hosted URL others can hitno β€” localhost (Docker image available to self-host)yes, no signup
Extend/proxy a real GraphQL APIexcellent (--extend)none
Fake-data directive richnessdozens of @fake types placed per field in SDL30+ field types on resource fields
Works offlineyesno
Maintenancelast commit Aug 2023; latest npm release ships no code; open "alternatives?" issue since Feb 2024actively developed

Written by the Mockbird maker β€” bias disclosed. Where graphql-faker genuinely wins: it consumes any SDL you write β€” if your workflow starts from a hand-crafted schema full of unions and interfaces, Mockbird cannot host that shape today and a patched-up graphql-faker (or a hand-rolled @graphql-tools/mock setup) is the right tool; its @fake directive placement is finer-grained than our field types; --extend proxy mode has no equivalent here; and it runs offline with no request caps. Every claim above was verified by us in August 2026: the 2.0.0 tarball listing came from npm's own registry (four files, no dist/), the behavioral walls from a local run of 2.0.0-rc.25 (port 9002, SDL as described), download counts from npm's public API for the Aug 18–24, 2026 week, and the Mockbird transcript from the live demo project before publishing. If any of this changes, we'll update the page.

Full GraphQL reference in the docs. More guides: free GraphQL mock API Β· @graphql-tools/mock alternative Β· json-graphql-server alternative Β· Prism alternative Β· mountebank alternative Β· deterministic test data Β· free mock API tools compared. Create your API β†’