json-graphql-server version 3.3.1 is a zero-configuration GraphQL testing and mocking tool for Node.js. Given a JSON data file or JavaScript module exporting arrays of entities, it spins up a full GraphQL API (queries, mutations, filters, pagination, sorting, and relationships) on localhost in under 30 seconds, no schema writing needed. Released under MIT with contributors from Marmelab; updates are infrequent but stable. Compared to alternatives like json-graphql-mocker or graphql-faker, this tool provides automatic schema generation and GraphiQL IDE out of the box, but does not support authentication, custom resolvers, or complex business logic.
npm install json-graphql-serverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a data file exporting entity arrays, then start server via CLI or programmatic middleware for zero-config GraphQL API.
Name your keys as plural lowercase (e.g., 'posts', 'users') to match expected conventions.
Check both 'errors' and 'error' in response; prefer using the 'graphql-http' client for compatibility.
Use '--port' instead of '-p' or '--p'.
Ensure each entity in an array has a unique 'id' field, numeric or string.
Run 'npm install -D json-graphql-server' in your project, or use 'npx json-graphql-server' with care (must be installed).
Use require: const jsonGraphqlServer = require('json-graphql-server');Check your entity key names and use correct query names (e.g., 'allPosts', 'allUsers').