https://github.com/graphql-editor/graphql-demeter
Advanced Automatic GraphQL Mock Server with Faker.js and AI support.
https://github.com/graphql-editor/graphql-demeter
Last synced: 3 months ago
JSON representation
Advanced Automatic GraphQL Mock Server with Faker.js and AI support.
- Host: GitHub
- URL: https://github.com/graphql-editor/graphql-demeter
- Owner: graphql-editor
- License: mit
- Created: 2024-01-08T23:45:28.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-05-28T08:29:39.000Z (about 1 year ago)
- Last Synced: 2025-08-22T12:41:42.671Z (10 months ago)
- Language: TypeScript
- Size: 143 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# GraphQL Demeter 🌾
**Alpha mode warning** This is in alpha mode, but releasing soon!
[](https://www.npmjs.com/package/graphql-demeter)
GraphQL Demeter is a TypeScript package and server that allows you to mock GraphQL Server responses. It provides various features such as auto-mock, AI-based mocks using OpenAI, and manual mock configuration.
## Getting Started
To get started with GraphQL Demeter, follow the installation instructions below.
## Installation
Install the package via npm:
```
npm install graphql-demeter
```
## Running
Just run the CLI on your schema.
```
demeter schema.graphql
```
Mock server should be running on port 4000
## Configuration
Demeter will automatically create config file on the first start `.graphql.demeter.js`.
As you can see if you provide type it will autocomplete faker values
```js
/** @type {import('graphql-demeter-core').FakerConfig} */
const config = {
objects: {
Card:{
description:{
values:["Very powerful card", "Most fire resistant character", "Good melee fighter"]
},
name:{
values:["Zeus", "Athena", "Hera", "Ares", "Kronos"]
},
image:{
fake:"internet.avatar"
}
}
},
scalars: {},
alwaysRequired: false,
};
module.exports = config
```
If the `alwaysRequired` field is `true`, it will always give mock values regardless of the required `!` mark in the schema.
## Development & Examples
1. Clone this repository
2. Install dependencies
3. Run npm run run-example
You should have your server running on port 4000 with sample schema. Feel free to modify schema locally to just test it with your schema.
## Roadmap
[ ] - reload on config change
[ ] - add ai possibilities with OpenAI Key