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

create-graphql-guru

v0.0.5

Published

Command line scaffolding and generator for Graphql Guru

Downloads

31

Readme

Create GraphQL Guru

Easily Scaffold and generate graphql servers

Quick overview


guru express my-server  
cd my-server  
npm run dev

Get Started Immediately

You don’t need to install or configure tools like Webpack or Babel. They are preconfigured and hidden so that you can focus on the code.

Just create a project, and you’re good to go.

Getting started

Installation

Install once globally:

npm install -g create-graphql-guru

You will need Node >= 6 on your machine. You can you n or nvm

Creating a server

To create a new server, run:

guru express my-server

cd my-server
npm run dev  

It will create a directory called my-server inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

my-server
├── bin
│   └── www
│       └── index.js
├── node_modules
├── public
├── server
│   ├── core
│   │   ├── database
│   │   ├── middleware
│   │   │   └── index-middleware.js
│   │   ├── routes
│   │   │   └── index-routes.js
│   │   └── database.js 
│   ├── modules
│   │   └── resolverQuery-hello.js 
│   │   └── schemaQuery-hello.graphql 
│   │   └── schemaType-hello.graphql 
│   │   └── access.js 
│   ├── queries
│   ├── views
│   │   └── layout 
│   │   └── index.hbs 
│   ├── environment.js
│   └── index.js
├── LICENSE
├── package.json
├── query-history.json
├── README.md
└── yarn.lock

No configuration or complicated folder structures, just the files you need to build your app. Once the installation is done, you can run some commands inside the project folder:

npm run dev or yarn run dev

Generating files

Types

guru type generate type definition.

Example

guru type  -m User -e "Enum USER GUEST" -o "User name:string lastName:String age:Int" 
 Usage: guru type [options]

Options:

  -m, --module <name>                 Module name
  -p, --path                          Path to where module will be created, relative to root.
  -e, --enum ["name value"]           creates Enum definition
  -f, --interface ["name key:value"]  interface definition
  -i, --input ["name key:value"]      input definition
  -o, --object ["name key:value"]     Object definition
  -s, --scalar ["name key:value"]     Scalar definition
  -u, --union ["name key:value"]      creates Union definition
  -h, --help                          output usage information

Queries

guru query generates resolver and schema queries.

Example

guru query -m User -d 'mongodb' -rs 'User' findAll findById

Query options

Usage: guru query [options]

Options:

  -m, --module <name>    Modules name
  -d, --database <name>  Extends module with database client
  -r, --resolver [true]  Create mutation resolve
  -s, --schema [true]    Name of query module
  -p, --path             Path to where module will be created, relative to root.
  -h, --help             output usage information

Mutations

guru mutation generates resolver and schema queries.

Example

guru mutation -m query -d 'mongodb' -rs 'User' create update remove

Mutation options

Usage: guru-mutation [options]

Options:

  -m, --module <name>    Modules name
  -d, --database <name>  Extends module with database client
  -r, --resolver [true]  Create mutation resolve
  -s, --schema [true]    Name of query module
  -p, --path             Path to where module will be created, relative to root.
  -h, --help             output usage information