https://github.com/penx/apollo-mock
CLI utility to start a mock server based upon a GraphQL schema file
https://github.com/penx/apollo-mock
Last synced: 6 months ago
JSON representation
CLI utility to start a mock server based upon a GraphQL schema file
- Host: GitHub
- URL: https://github.com/penx/apollo-mock
- Owner: penx
- Created: 2020-03-27T13:04:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-12T07:45:08.000Z (about 3 years ago)
- Last Synced: 2025-07-12T17:26:40.414Z (6 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/apollo-mock
- Size: 168 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Apollo Mock
CLI utility to start a mock server based upon a GraphQL schema file.
Uses [Apollo Server](https://github.com/apollographql/apollo-server).
## Install
Inside the project where your spec file is:
```sh
npm init -y
npm install -d apollo-mock apollo-server
```
Then add a script in package.json such as:
```json
"scripts": {
"mock": "apollo-mock ./schema.graphql"
}
```
And lastly run `npm run mock`.
## Usage
```
Usage: apollo-mock [options]
Options:
-V, --version output the version number
-p, --port port to start the mock server on
-m, --mocks path to mocks JavaScript file
-h, --help display help for command
```