npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gb-graphql-cli

v0.2.1

Published

A Command Line interface for GraphQL applications.

Downloads

3

Readme

GraphQL CLI

A Command Line interface for GraphQL applications.

GitHub forks GitHub stars

GitHub license

Usage

Installation

npm install -g gb-graphql-cli

Running gb-graphql-cli --help

Usage: gb-graphql-cli [options] [command]

Options:

  -v, --version              output the version number
  -h, --help                 output usage information

Commands:

  init [options] <projname>  Init the GraphQL project
  run                        Start the development server
  create <schema> <name>     Create files based on a schematic. Possible schemas: (model, resource)

Examples:
   gb-graphql-cli init helloWorld
   gb-graphql-cli init helloWorld -d mssql
   gb-graphql-cli init helloWorld -a
   gb-graphql-cli run
   gb-graphql-cli create model example

How to Use - Initializing a new GraphQL project

Assuming that you have installed the cli, follow the steps below for run your first application.

  1. The first step, is initialize the project:
gb-graphql-cli init helloWorld
# If you are using another DBMS, you can set like that:
# Possible values: (mysql, mssql, sqlite, postgres)
gb-graphql-cli init helloWorld --dialect mssql
  1. Don't forget that you have to change the JWT_SECRET in package.json.
  2. After the initialization finishes, you have to start your database service and create a database named "helloWorld".
  3. With database service started, go to config.json file, located in "helloWorld/src/config/config.json".
  4. Change the "database" key, of key "development" to the name "helloWorld".
{
    "development": {
        "username": "root",
        "password": null,
        "database": "helloWorld",
        "host": "127.0.0.1",
        "dialect": "mysql"
    },
    "test": {
        "username": "root",
        "password": null,
        "database": "database_test",
        "host": "127.0.0.1",
        "dialect": "mysql"
    },
    "production": {
        "username": "root",
        "password": null,
        "database": "database_production",
        "host": "127.0.0.1",
        "dialect": "mysql"
    }
}
  1. Now it's time to run the application. Go to main of your project and type gb-graphql-cli run.
  2. Wait for the build and the nodemon server being ready.
  3. Access localhost:3000/graphql. As this application is from GraphQL, just have one end-point. In development environment, accessing this end-point in browser you will see the GraphiQL interface.
  4. Now you can create mutations and queries for the ExampleModel.
  5. Enjoy!