0.6.7 • Published 6 years ago

gapi-cli v0.6.7

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

This is CLI project related with GAPI graphQL api with typescript Decorators

WIKI

Gapi - Advanced graphql server with typescript decorators

Starter - Basic starter project

Starter-advanced - Advanced starter project

Gapi-angular-client - Gapi Apollo Angular client

To install gapi utility type following command:

npm i -g gapi-cli

To create new basic project from scratch via CLI type:

gapi new my-project

To create new advanced project from scratch via CLI type:

gapi new my-project --advanced

Available commands

Create new project
gapi new project-name
Start created project.
gapi start
(Uses internally on every restart to introspect api schema check "gapi schema introspect" command)
Can be disabled inside package.json > nodemonConfig > events > restart
With this configuration it will make request to localhost:9000 and will take current API schema then will generate graphql.d.ts based on introspection
  "nodemonConfig": {
    "events": {
      "restart": "sleep 1 && gapi schema introspect"
    }
  },
Start production (it will start pm2 and will use process.yml file inside working directory)
gapi start --prod
Start production inside Docker(it will start pm2-docker and will use process.yml file inside working directory)
gapi start --prod --docker

Start testing

Run single test iteration
Will take config > test > local configuration inside gapi-cli.conf.yml
gapi test
Run tests in watch mode
gapi test --watch
Run tests with different environment
It will take configuration from gapi-cli.conf.yml
You can extend configurations from APP when you write after environment "extends app/my-environment"

Custom testing environments

config:
  app:
    local: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
    prod: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
    my-environment: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
  test:
    my-environment: extends app/my-environment
    local: extends app/local
    prod: extends app/prod
    worker:
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
Running with Testing worker environment
gapi test --worker

Running with Production environment

gapi test --prod
Running with custom enviroment
gapi test --my-enviroment

Schema

Schema introspection
It will generate graphql.d.ts file based on given address and output folder
Uses gapi-cli.conf.yml file
config:
  schema:
    introspectionEndpoint: http://localhost:9000/graphql
    introspectionOutputFolder: ./src/app/core/api-introspection
gapi schema introspect
Available shared commands are:
--verbose - Show better logging
0.6.7

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.2

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.9

6 years ago

0.5.8

6 years ago

0.5.7

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.7

6 years ago

0.4.6

6 years ago

0.4.5

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago