gqlmocks
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,1 +0,1 @@ | ||
{"version":"0.0.0","commands":{"serve":{"id":"serve","description":"run a local graphql server","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks serve --schema ../schema.graphql","$ gqlmocks serve --schema ../schema.graphql --handler ../handler.ts","$ gqlmocks serve --schema http://s3-bucket/schema.graphql --faker","$ gqlmocks serve --schema http://graphql-api/ --faker","$ gqlmocks serve --schema http://graphql-api/ --header \"Authorization=Bearer token\" --faker"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false},"handler":{"name":"handler","type":"option","char":"h","description":"path to file with graphql handler","multiple":false},"header":{"name":"header","type":"option","description":"specify header(s) used in the request for remote schema specified by --schema flag","multiple":true,"dependsOn":["schema"]},"faker":{"name":"faker","type":"boolean","char":"f","description":"use faker middlware for resolvers","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"Port to serve on","multiple":false,"default":"4444"},"watch":{"name":"watch","type":"boolean","char":"w","description":"(experimental) watch changes made to the handler or schema and reload","hidden":true,"allowNo":false}},"args":[]},"config:generate":{"id":"config:generate","description":"generate or update a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config generate","$ gqlmocks config generate --force","$ gqlmocks config generate --save-config \"./path/to/gqlmocks.config.js\"","$ gqlmocks config generate --schema.path \"./graphql-mocks/schema.graphql\" --schema.format \"SDL_STRING\"","$ gqlmocks config generate --handler.path \"./graphql-mocks/handler.js\""],"flags":{"save-config":{"name":"save-config","type":"option","description":"path to write generated config to","multiple":false},"format":{"name":"format","type":"option","description":"specify the output format of the gqlmocks config","multiple":false,"options":["ts","js","json"]},"schema.path":{"name":"schema.path","type":"option","description":"path to GraphQL schema","multiple":false},"schema.format":{"name":"schema.format","type":"option","multiple":false,"options":["SDL","SDL_STRING"]},"handler.path":{"name":"handler.path","type":"option","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite config if one exists","allowNo":false}},"args":[]},"config:info":{"id":"config:info","description":"display info about a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config info","$ gqlmocks config info --config \"../gqlmocks.config.js\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"config:validate":{"id":"config:validate","description":"validate a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config validate","$ gqlmocks config validate --config \"path/to/gqlmocks.config.js\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"handler:generate":{"id":"handler:generate","description":"generate a graphql handler","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlconfig handler generate","$ gqlconfig handler generate --force","$ gqlconfig handler generate --save-handler \"path/to/gqlmocks.config.js\"","$ gqlconfig handler generate --format \"ts\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"save-handler":{"name":"save-handler","type":"option","description":"path to write generated config to","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite config if one already exists","allowNo":false},"format":{"name":"format","type":"option","description":"specify the file format of the created handler file","multiple":false,"options":["ts","js"]}},"args":[]},"handler:info":{"id":"handler:info","description":"display info about a graphql handler","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks handler info","$ gqlmocks handler info --handler path/to/handler.js"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"handler":{"name":"handler","type":"option","char":"h","description":"path to file with graphql handler","multiple":false}},"args":[]},"schema:fetch":{"id":"schema:fetch","description":"fetch and save a graphql schema locally","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema fetch","$ gqlmocks schema fetch --force","$ gqlmocks schema fetch --source \"http://remote.com/schema.graphql\"","$ gqlmocks schema fetch --source \"http://remote-gql-api.com\"","$ gqlmocks schema fetch --source \"http://remote-gql-api.com\" --header \"Authorization=Bearer abc123\" --header \"Header=Text\"","$ gqlmocks schema fetch --format \"SDL_STRING\""],"flags":{"header":{"name":"header","type":"option","description":"specify header(s) used in the request for remote schema specified by --schema flag","multiple":true,"dependsOn":["schema"]},"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"save-schema":{"name":"save-schema","type":"option","description":"path of file to save schema to","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite a schema file if one already exists","allowNo":false},"format":{"name":"format","type":"option","description":"format to save the schema as","multiple":false,"options":["SDL","SDL_STRING"],"default":"SDL"},"source":{"name":"source","type":"option","description":"url of graphql api server or url of remote .graphql file","multiple":false}},"args":[]},"schema:info":{"id":"schema:info","description":"display info about a graphql schema","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema info","$ gqlmocks schema info --schema \"path/to/schema.graphql\""],"flags":{"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false},"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"schema:validate":{"id":"schema:validate","description":"validate a graphql schema file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema validate","$ gqlmocks schema validate --schema \"path/to/schema.graphql\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false}},"args":[]}}} | ||
{"version":"0.1.1","commands":{"serve":{"id":"serve","description":"run a local graphql server","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks serve --schema ../schema.graphql","$ gqlmocks serve --schema ../schema.graphql --handler ../handler.ts","$ gqlmocks serve --schema http://s3-bucket/schema.graphql --faker","$ gqlmocks serve --schema http://graphql-api/ --faker","$ gqlmocks serve --schema http://graphql-api/ --header \"Authorization=Bearer token\" --faker"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false},"handler":{"name":"handler","type":"option","char":"h","description":"path to file with graphql handler","multiple":false},"header":{"name":"header","type":"option","description":"specify header(s) used in the request for remote schema specified by --schema flag","multiple":true,"dependsOn":["schema"]},"faker":{"name":"faker","type":"boolean","char":"f","description":"use faker middlware for resolvers","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"Port to serve on","multiple":false,"default":"4444"},"watch":{"name":"watch","type":"boolean","char":"w","description":"(experimental) watch changes made to the handler or schema and reload","hidden":true,"allowNo":false}},"args":[]},"config:generate":{"id":"config:generate","description":"generate or update a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config generate","$ gqlmocks config generate --force","$ gqlmocks config generate --save-config \"./path/to/gqlmocks.config.js\"","$ gqlmocks config generate --schema.path \"./graphql-mocks/schema.graphql\" --schema.format \"SDL_STRING\"","$ gqlmocks config generate --handler.path \"./graphql-mocks/handler.js\""],"flags":{"save-config":{"name":"save-config","type":"option","description":"path to write generated config to","multiple":false},"format":{"name":"format","type":"option","description":"specify the output format of the gqlmocks config","multiple":false,"options":["ts","js","json"]},"schema.path":{"name":"schema.path","type":"option","description":"path to GraphQL schema","multiple":false},"schema.format":{"name":"schema.format","type":"option","multiple":false,"options":["SDL","SDL_STRING"]},"handler.path":{"name":"handler.path","type":"option","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite config if one exists","allowNo":false}},"args":[]},"config:info":{"id":"config:info","description":"display info about a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config info","$ gqlmocks config info --config \"../gqlmocks.config.js\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"config:validate":{"id":"config:validate","description":"validate a gqlmocks config file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks config validate","$ gqlmocks config validate --config \"path/to/gqlmocks.config.js\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"handler:generate":{"id":"handler:generate","description":"generate a graphql handler","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlconfig handler generate","$ gqlconfig handler generate --force","$ gqlconfig handler generate --save-handler \"path/to/gqlmocks.config.js\"","$ gqlconfig handler generate --format \"ts\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"save-handler":{"name":"save-handler","type":"option","description":"path to write generated config to","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite config if one already exists","allowNo":false},"format":{"name":"format","type":"option","description":"specify the file format of the created handler file","multiple":false,"options":["ts","js"]}},"args":[]},"handler:info":{"id":"handler:info","description":"display info about a graphql handler","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks handler info","$ gqlmocks handler info --handler path/to/handler.js"],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"handler":{"name":"handler","type":"option","char":"h","description":"path to file with graphql handler","multiple":false}},"args":[]},"schema:fetch":{"id":"schema:fetch","description":"fetch and save a graphql schema locally","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema fetch","$ gqlmocks schema fetch --force","$ gqlmocks schema fetch --source \"http://remote.com/schema.graphql\"","$ gqlmocks schema fetch --source \"http://remote-gql-api.com\"","$ gqlmocks schema fetch --source \"http://remote-gql-api.com\" --header \"Authorization=Bearer abc123\" --header \"Header=Text\"","$ gqlmocks schema fetch --format \"SDL_STRING\""],"flags":{"header":{"name":"header","type":"option","description":"specify header(s) used in the request for remote schema specified by --schema flag","multiple":true,"dependsOn":["schema"]},"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"save-schema":{"name":"save-schema","type":"option","description":"path of file to save schema to","multiple":false},"force":{"name":"force","type":"boolean","description":"overwrite a schema file if one already exists","allowNo":false},"format":{"name":"format","type":"option","description":"format to save the schema as","multiple":false,"options":["SDL","SDL_STRING"],"default":"SDL"},"source":{"name":"source","type":"option","description":"url of graphql api server or url of remote .graphql file","multiple":false}},"args":[]},"schema:info":{"id":"schema:info","description":"display info about a graphql schema","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema info","$ gqlmocks schema info --schema \"path/to/schema.graphql\""],"flags":{"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false},"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false}},"args":[]},"schema:validate":{"id":"schema:validate","description":"validate a graphql schema file","strict":true,"pluginName":"gqlmocks","pluginAlias":"gqlmocks","pluginType":"core","aliases":[],"examples":["$ gqlmocks schema validate","$ gqlmocks schema validate --schema \"path/to/schema.graphql\""],"flags":{"config":{"name":"config","type":"option","char":"c","description":"path to config file","multiple":false},"schema":{"name":"schema","type":"option","char":"s","description":"local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql api endpoint)","multiple":false}},"args":[]}}} |
{ | ||
"name": "gqlmocks", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": "Chad Carbert @chadian", | ||
@@ -76,5 +76,5 @@ "bin": { | ||
"postpack": "rm -f oclif.manifest.json", | ||
"prepack": "rm -rf lib && oclif readme && yarn build", | ||
"prepack": "rm -rf lib && oclif readme && yarn build", | ||
"test": "NODE_ENV=development mocha \"test/**/*.test.ts\"", | ||
"build": "tsc && yarn copy-blueprints", | ||
"build": "tsc && yarn copy-blueprints && oclif manifest", | ||
"test-build": "mocha \"test/**/*.test.ts\"", | ||
@@ -84,3 +84,3 @@ "copy-blueprints": "mkdir -p lib/blueprints && cp -r src/blueprints lib" | ||
"types": "lib/index.d.ts", | ||
"gitHead": "d854a553c0d47f9f42657dd3ca64a215e09f882e" | ||
"gitHead": "1c3d9e877ba3a02c17dde0e0b1317d4665a4da8b" | ||
} |
246
README.md
# Commands | ||
<!-- commands --> | ||
* [`gqlmocks config generate`](#gqlmocks-config-generate) | ||
* [`gqlmocks config info`](#gqlmocks-config-info) | ||
* [`gqlmocks config validate`](#gqlmocks-config-validate) | ||
* [`gqlmocks handler generate`](#gqlmocks-handler-generate) | ||
* [`gqlmocks handler info`](#gqlmocks-handler-info) | ||
* [`gqlmocks help [COMMAND]`](#gqlmocks-help-command) | ||
* [`gqlmocks schema fetch`](#gqlmocks-schema-fetch) | ||
* [`gqlmocks schema info`](#gqlmocks-schema-info) | ||
* [`gqlmocks schema validate`](#gqlmocks-schema-validate) | ||
* [`gqlmocks serve`](#gqlmocks-serve) | ||
* [`gqlmocks version`](#gqlmocks-version) | ||
## `gqlmocks config generate` | ||
generate or update a gqlmocks config file | ||
``` | ||
USAGE | ||
$ gqlmocks config generate [--save-config <value>] [--format ts|js|json] [--schema.path <value>] [--schema.format | ||
SDL|SDL_STRING] [--handler.path <value>] [--force] | ||
FLAGS | ||
--force overwrite config if one exists | ||
--format=<option> specify the output format of the gqlmocks config | ||
<options: ts|js|json> | ||
--handler.path=<value> | ||
--save-config=<value> path to write generated config to | ||
--schema.format=<option> <options: SDL|SDL_STRING> | ||
--schema.path=<value> path to GraphQL schema | ||
DESCRIPTION | ||
generate or update a gqlmocks config file | ||
EXAMPLES | ||
$ gqlmocks config generate | ||
$ gqlmocks config generate --force | ||
$ gqlmocks config generate --save-config "./path/to/gqlmocks.config.js" | ||
$ gqlmocks config generate --schema.path "./graphql-mocks/schema.graphql" --schema.format "SDL_STRING" | ||
$ gqlmocks config generate --handler.path "./graphql-mocks/handler.js" | ||
``` | ||
## `gqlmocks config info` | ||
display info about a gqlmocks config file | ||
``` | ||
USAGE | ||
$ gqlmocks config info [-c <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
DESCRIPTION | ||
display info about a gqlmocks config file | ||
EXAMPLES | ||
$ gqlmocks config info | ||
$ gqlmocks config info --config "../gqlmocks.config.js" | ||
``` | ||
## `gqlmocks config validate` | ||
validate a gqlmocks config file | ||
``` | ||
USAGE | ||
$ gqlmocks config validate [-c <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
DESCRIPTION | ||
validate a gqlmocks config file | ||
EXAMPLES | ||
$ gqlmocks config validate | ||
$ gqlmocks config validate --config "path/to/gqlmocks.config.js" | ||
``` | ||
## `gqlmocks handler generate` | ||
generate a graphql handler | ||
``` | ||
USAGE | ||
$ gqlmocks handler generate [-c <value>] [--save-handler <value>] [--force] [--format ts|js] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
--force overwrite config if one already exists | ||
--format=<option> specify the file format of the created handler file | ||
<options: ts|js> | ||
--save-handler=<value> path to write generated config to | ||
DESCRIPTION | ||
generate a graphql handler | ||
EXAMPLES | ||
$ gqlconfig handler generate | ||
$ gqlconfig handler generate --force | ||
$ gqlconfig handler generate --save-handler "path/to/gqlmocks.config.js" | ||
$ gqlconfig handler generate --format "ts" | ||
``` | ||
## `gqlmocks handler info` | ||
display info about a graphql handler | ||
``` | ||
USAGE | ||
$ gqlmocks handler info [-c <value>] [-h <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
-h, --handler=<value> path to file with graphql handler | ||
DESCRIPTION | ||
display info about a graphql handler | ||
EXAMPLES | ||
$ gqlmocks handler info | ||
$ gqlmocks handler info --handler path/to/handler.js | ||
``` | ||
## `gqlmocks help [COMMAND]` | ||
@@ -24,4 +155,117 @@ | ||
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.11/src/commands/help.ts)_ | ||
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v5.1.12/src/commands/help.ts)_ | ||
## `gqlmocks schema fetch` | ||
fetch and save a graphql schema locally | ||
``` | ||
USAGE | ||
$ gqlmocks schema fetch [--header <value> ] [-c <value>] [--save-schema <value>] [--force] [--format | ||
SDL|SDL_STRING] [--source <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
--force overwrite a schema file if one already exists | ||
--format=<option> [default: SDL] format to save the schema as | ||
<options: SDL|SDL_STRING> | ||
--header=<value>... specify header(s) used in the request for remote schema specified by --schema flag | ||
--save-schema=<value> path of file to save schema to | ||
--source=<value> url of graphql api server or url of remote .graphql file | ||
DESCRIPTION | ||
fetch and save a graphql schema locally | ||
EXAMPLES | ||
$ gqlmocks schema fetch | ||
$ gqlmocks schema fetch --force | ||
$ gqlmocks schema fetch --source "http://remote.com/schema.graphql" | ||
$ gqlmocks schema fetch --source "http://remote-gql-api.com" | ||
$ gqlmocks schema fetch --source "http://remote-gql-api.com" --header "Authorization=Bearer abc123" --header "Header=Text" | ||
$ gqlmocks schema fetch --format "SDL_STRING" | ||
``` | ||
## `gqlmocks schema info` | ||
display info about a graphql schema | ||
``` | ||
USAGE | ||
$ gqlmocks schema info [-s <value>] [-c <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
-s, --schema=<value> local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql | ||
api endpoint) | ||
DESCRIPTION | ||
display info about a graphql schema | ||
EXAMPLES | ||
$ gqlmocks schema info | ||
$ gqlmocks schema info --schema "path/to/schema.graphql" | ||
``` | ||
## `gqlmocks schema validate` | ||
validate a graphql schema file | ||
``` | ||
USAGE | ||
$ gqlmocks schema validate [-c <value>] [-s <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
-s, --schema=<value> local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql | ||
api endpoint) | ||
DESCRIPTION | ||
validate a graphql schema file | ||
EXAMPLES | ||
$ gqlmocks schema validate | ||
$ gqlmocks schema validate --schema "path/to/schema.graphql" | ||
``` | ||
## `gqlmocks serve` | ||
run a local graphql server | ||
``` | ||
USAGE | ||
$ gqlmocks serve [-c <value>] [-h <value>] [--header <value> -s <value>] [-f] [-p <value>] | ||
FLAGS | ||
-c, --config=<value> path to config file | ||
-f, --faker use faker middlware for resolvers | ||
-h, --handler=<value> path to file with graphql handler | ||
-p, --port=<value> [default: 4444] Port to serve on | ||
-s, --schema=<value> local path to graphql schema (relative or absolute), remote url (graphql schema file or graphql | ||
api endpoint) | ||
--header=<value>... specify header(s) used in the request for remote schema specified by --schema flag | ||
DESCRIPTION | ||
run a local graphql server | ||
EXAMPLES | ||
$ gqlmocks serve --schema ../schema.graphql | ||
$ gqlmocks serve --schema ../schema.graphql --handler ../handler.ts | ||
$ gqlmocks serve --schema http://s3-bucket/schema.graphql --faker | ||
$ gqlmocks serve --schema http://graphql-api/ --faker | ||
$ gqlmocks serve --schema http://graphql-api/ --header "Authorization=Bearer token" --faker | ||
``` | ||
_See code: [src/commands/serve.ts](https://github.com/graphql-mocks/graphql-mocks/blob/main/packages/cli/src/commands/serve.ts)_ | ||
## `gqlmocks version` | ||
@@ -28,0 +272,0 @@ |
75070
20
279