graphql-serve
<p align="center"> <img width="400" src="https://github.com/aerogear/graphback/raw/master/website/static/img/graphback.png"> <br/> Auto generate database structure, <br/> GraphQL Resolvers and Queries from GraphQL types 🚀 </p>
Last updated 7 years ago by aerogear-ci .
Apache 2.0 · Original npm · Tarball · package.json
$ npm install graphql-serve 
SYNC missed versions from official npm registry.

Graphback


Auto generate database structure,
GraphQL Resolvers and Queries from GraphQL types 🚀

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 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:

$ gqls serve models --port=8080

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

$ gqls 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:

$ gqls -h
gqls <command>

Commands:
  gqls print-schema [modelDir]     Generate and print GraphQL schema from data
                                   model files
  gqls 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:

$ gqls serve -h
gqls 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]
  -h, --help     Show help                                             [boolean]
  -v, --version  Show version number                                   [boolean]

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

Also for print-schema command:

$ gqls print-schema -h
gqls 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:
  gqls 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

Extension to GraphQL TestX

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

Current Tags

  • 1.1.2                                ...           latest (6 years ago)
  • 1.1.0-alpha2                                ...           next (6 years ago)

65 Versions

  • 1.1.2                                ...           6 years ago
  • 1.1.1                                ...           6 years ago
  • 1.1.0                                ...           6 years ago
  • 1.1.0-alpha2                                ...           6 years ago
  • 1.1.0-alpha1                                ...           6 years ago
  • 1.0.1                                ...           6 years ago
  • 1.0.0-beta7                                ...           6 years ago
  • 1.0.0-beta6                                ...           6 years ago
  • 1.0.0-beta5                                ...           6 years ago
  • 1.0.0-beta4                                ...           6 years ago
  • 1.0.0-beta3                                ...           6 years ago
  • 1.0.0-beta2                                ...           6 years ago
  • 1.0.0-beta1                                ...           6 years ago
  • 0.16.2                                ...           6 years ago
  • 0.16.1                                ...           6 years ago
  • 0.16.0                                ...           6 years ago
  • 0.16.0-beta4                                ...           6 years ago
  • 0.16.0-beta3                                ...           6 years ago
  • 0.16.0-beta2                                ...           6 years ago
  • 0.16.0-beta1                                ...           6 years ago
  • 0.16.0-alpha7                                ...           6 years ago
  • 0.16.0-alpha6                                ...           6 years ago
  • 0.16.0-alpha5                                ...           6 years ago
  • 0.16.0-alpha4                                ...           6 years ago
  • 0.16.0-alpha3                                ...           6 years ago
  • 0.16.0-alpha2                                ...           6 years ago
  • 0.16.0-alpha1                                ...           6 years ago
  • 0.15.1                                ...           6 years ago
  • 0.15.0                                ...           6 years ago
  • 0.15.0-alpha1                                ...           6 years ago
  • 0.14.1                                ...           6 years ago
  • 0.14.0                                ...           6 years ago
  • 0.14.0-beta6                                ...           6 years ago
  • 0.14.0-beta5                                ...           6 years ago
  • 0.14.0-beta4                                ...           6 years ago
  • 0.14.0-beta3                                ...           6 years ago
  • 0.14.0-beta1                                ...           6 years ago
  • 0.14.0-alpha14                                ...           6 years ago
  • 0.14.0-alpha13                                ...           6 years ago
  • 0.14.0-alpha12                                ...           6 years ago
  • 0.14.0-alpha11                                ...           6 years ago
  • 0.14.0-alpha10                                ...           6 years ago
  • 0.14.0-alpha9                                ...           6 years ago
  • 0.14.0-alpha8                                ...           6 years ago
  • 0.14.0-alpha7                                ...           6 years ago
  • 0.14.0-alpha6                                ...           6 years ago
  • 0.14.0-alpha5                                ...           6 years ago
  • 0.14.0-alpha4                                ...           6 years ago
  • 0.14.0-alpha3                                ...           6 years ago
  • 0.12.1                                ...           6 years ago
  • 0.14.0-alpha2                                ...           6 years ago
  • 0.14.0-alpha1                                ...           7 years ago
  • 0.14.0-dev3                                ...           7 years ago
  • 0.14.0-dev2                                ...           7 years ago
  • 0.14.0-dev1                                ...           7 years ago
  • 0.12.0                                ...           7 years ago
  • 0.11.4                                ...           7 years ago
  • 0.11.3                                ...           7 years ago
  • 0.11.2                                ...           7 years ago
  • 0.11.1                                ...           7 years ago
  • 0.11.0                                ...           7 years ago
  • 0.10.0                                ...           7 years ago
  • 0.4.1                                ...           7 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
Maintainers (1)
Downloads
Total 119
Today 1
This Week 15
This Month 100
Last Day 1
Last Week 19
Last Month 19
Dependencies (23)
Dev Dependencies (15)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE