Plugin for graphql-cli. Generates static bindings for any GraphQL schema using graphql-static-binding (WIP!) and outputs a code file.
Install graphql-cli-binding either globally (recommended) or locally using your favorite package manager:
$ yarn [global] add graphql-cli-binding
$ npm install graphql-cli-binding [--global]graphql bindings [schema]
Generate static bindings for the schema and output to a single code file
Options:
--dotenv Path to .env file [string]
-p, --project Project name [string]
--schema Schema file to process [string]
--output, -o Filename of output code file [string] [required]
--generator, -g Generator used to generate binding files [string]
--force, -f Force overwriting exissting output file [boolean]
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
Currently, the following generators are available:
graphcool-ts: Generate Typescript binding file based ongraphcool-bindinggraphcool-js: Generate Javascript binding file based ongraphcool-bindingbinding-ts: Generate Typescript binding file based ongraphql-bindingbinding-js: Generate Javascript binding file based ongraphql-binding
You can also pass your own generator file to --generator.