Skip to content

CLI utility to start a mock server based upon a GraphQL schema file

Notifications You must be signed in to change notification settings

penx/apollo-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apollo Mock

CLI utility to start a mock server based upon a GraphQL schema file.

Uses Apollo Server.

Install

Inside the project where your spec file is:

npm init -y
npm install -d apollo-mock apollo-server

Then add a script in package.json such as:

"scripts": {
    "mock": "apollo-mock ./schema.graphql"
}

And lastly run npm run mock.

Usage

Usage: apollo-mock [options] <schema>

Options:
  -V, --version      output the version number
  -p, --port <n>     port to start the mock server on
  -m, --mocks <dir>  path to mocks JavaScript file
  -h, --help         display help for command

About

CLI utility to start a mock server based upon a GraphQL schema file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published