GraphQL Faker v2.0.0 is a CLI tool for mocking or extending GraphQL APIs with realistic fake data from faker.js, requiring no coding. It uses custom directives like @fake, @examples, and @listLength in GraphQL SDL to generate data. Supports proxying existing GraphQL APIs (e.g., GitHub, SWAPI) and extending them with mock fields. Ships with an interactive editor integrating GraphiQL. Requires Node >= 18.12.0. Major v2 release dropped support for older Node versions and may have breaking changes. Release cadence is irregular; maintained on GitHub. Key differentiator: no-code faking with rich directive support and proxy capability.
npm install graphql-fakerNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates an SDL file with directives and starts the faker server with interactive editor.
Upgrade Node.js to version 18.12.0 or later.
Refer to @faker-js/faker documentation for @fake type names (e.g., 'firstName' is now 'person.firstName' in newer versions).
Use --header or --forward-headers to pass authentication tokens.
Omit --open in headless environments or use Docker with DISPLAY configured.
Run: npm install -g graphql-faker
Use @fake(type: firstName) instead of @fake(type: 'firstName')
Use --port to specify a different port, e.g., graphql-faker --port 3000