Skip to content

Commit

Permalink
Add examples to usage
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 22, 2017
1 parent ed8a03b commit f40033b
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import * as opn from 'opn';

const DEFAULT_PORT = 9002;
const argv = require('yargs')
.usage('$0 [file]')
.usage('Usage: $0 [file]')
.alias('p', 'port')
.nargs('p', 1)
.describe('p', 'HTTP Port')
Expand All @@ -32,6 +32,17 @@ const argv = require('yargs')
.implies('header', 'extend')
.help('h')
.alias('h', 'help')
.epilog(`Examples:
# Mock GraphQL API based on IDL and open interactive editor
$0 ./my-idl.grqphql --open
# Extend real data from SWAPI with faked based on extension IDL
$0 ./ext-swapi.grqphql -e http://swapi.graphene-python.org/graphql
# Extend real data from GitHub API with faked based on extension IDL
$0 ./ext-gh.graphql -e https://api.github.com/graphql \\
-H “Authorization: bearer <TOKEN>"`)
.argv

const log = console.log;
Expand Down

0 comments on commit f40033b

Please sign in to comment.