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

graphql-serve

v1.1.2

Published

<p align="center"> <img width="400" src="https://raw.githubusercontent.com/aerogear/graphback/master/website/static/img/logo.png"/> <br/> Auto generate database structure, <br/> GraphQL Resolvers and Queries from GraphQL types πŸš€ </p>

Downloads

340

Readme

Graphback

Documentation: https://graphback.dev Repository: https://github.com/aerogear/graphback/

graphql-serve

Fully functional GraphQL Server based on Graphback CRUD Specification

graphql-serve is a full-featured GraphQL server, based on Graphback and Apollo Server. With the minimum configuration required, you have a server ready for testing GraphQL client applications or libraries. Unlike mocking alternatives, graphql-serve offers persistent data between queries and mutation using in-memory SQLite database.

Getting Started

Installation

Using npm:

npm install -g graphql-serve

or yarn:

yarn global add graphql-serve

Usage

gqlserve

The gqlserve command only needs one or more *.graphql data model file(s) in order to setup a working GraphQL server. Here is an example model file:

""" @model """
type Note {
  id: ID!
  title: String!
  description: String
  likes: Int
}

Assuming you have created your various *.graphql data model files in the models directory, to automatically generate resolvers and start a GraphQL server listening on port 8080 do the following:

$ gqlserve serve models --port=8080

If you only need to see the generated GraphQL Schema, use the print-schema command:

$ gqlserve print-schema .

The above command prints schema generated from data model files in the current directory.

This information is also provided with the command itself:

$ gqlserve -h
gqlserve <command>

Commands:
  gqlserve print-schema [modelDir]     Generate and print GraphQL schema from data
                                   model files
  gqlserve serve [modelDir] [options]  Generate and start GraphQL server from data
                                   model files

Options:
  -h, --help     Show help                                             [boolean]
  -v, --version  Show version number                                   [boolean]

For the serve command:

$ gqlserve serve -h
gqlserve serve [modelDir] [options]

Generate and start GraphQL server from data model files

Positionals:
  modelDir, model  Directory to search for data models                  [string]

Options:
  --port, -p        Specify the port on which to listen on              [number]
  --datasync, --ds  Enable datasynchronization features                [boolean]
  -h, --help        Show help                                          [boolean]
  -v, --version     Show version number                                [boolean]

Examples:
  gqlserve serve . -p 8080  generate schema from data model files in current
                            directory and start GraphQL server on port 8080

Also for print-schema command:

$ gqlserve print-schema -h
gqlserve print-schema [modelDir]

Generate and print GraphQL schema from data model files

Positionals:
  modelDir, model  Directory to search for data models                  [string]

Options:
  -h, --help     Show help                                             [boolean]
  -v, --version  Show version number                                   [boolean]

Examples:
  gqlserve print-schema modelDir  only display generated schema from data model
                              files in modelDir directory and quit

Under to hood we use Graphback to parse the Type Definitions/Data Model and generate the GraphQL schema and resolvers. See the Graphback Docs on Data Model Definition and Data Synchronization for data synchronization features.

Extension to GraphQL TestX

GraphQL serve is based on GraphQL-TestX: https://github.com/aerogear/graphql-testx