GraphQL API Server template
This is a fbi project template. If you haven't installed fbi yet, use the following command to install.
$ npm i -g fbi
oryarn global add fbi
fbi v3.0+
node v7.6+
- Code generation: generate 'schema types' and 'resolvers' base on schema
- GraphQLServer base on graphql-yoga
- Environment data config
- Local development server using nodemon
- Debug in VSCode
-
Add template
$ fbi add https://github.com/fbi-templates/fbi-project-graphql.git
-
Create a project
$ fbi init graphql [target-folder] -o
-
Run a task
# First run (generate code and start dev server) $ fbi g s # As long as the files in 'src/schema' have changed, you should run 'fbi g' again
-
Debug in VSCode
# 1. Start dev server $ fbi s # 2. Attach existing process: Press `F5` in VSCode (support breakpoints in `src`)
-
Update template
$ fbi up graphql
-
Update options
$ cd path/to/my-app $ fbi init -o
$ npm start
- Description: Generate 'schema types' and 'resolvers' base on schema, config:
fbi/options.js generate
. - Alias:
g
- Examples:
fbi g
- Description: Compile and start development server.
- Alias:
s
- Examples:
fbi s
- Description: Build the project for the specified environment.
- Params:
p/prod
{Boolean}
(default) Production environment.t/test
{Boolean}
Test environment.
- Alias:
b
- Examples:
fbi b -t
fbi b -p