Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 1.21 KB

README.md

File metadata and controls

43 lines (34 loc) · 1.21 KB

Code-generator

Command line utility to auto-generate the structure files that this server will use to perform CRUD operations for each model created.

Set up:

Clone the repository and run:

$ npm install
$ npm link

Usage:

$ code-generator generate <input-json-files> <output-directory>

or with the alias:

$ code-generator g <input-json-files> <output-directory>
INPUT:
<input-json-files> - directory where json models are stored
<output-directory> - directory where the generated code will be written

This command will create(if doesn't exist) four folders containing the files created for each model in the input-json-files:

  • models ----> sequelize model
  • schemas ----> graphQL schema
  • resolvers ----> basic CRUD resolvers
  • migrations ----> create and delete table migration file

Example of use:

In the same directory of this repository run:

$ code-generator --generate ./example_json_files /your_path_directory

If you want to complete the example with the server make /your_path_directory the same directory where the server repository is stored.