graphql-serve

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

Apache 2.0 65 个版本
安装
npm install graphql-serve
yarn add graphql-serve
pnpm add graphql-serve
bun add graphql-serve
README

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

版本列表
1.1.2 2021-02-24
1.1.1 2021-02-05
1.1.0 2020-11-10
1.1.0-alpha2 2020-10-20
1.1.0-alpha1 2020-10-08
1.0.1 2020-09-25
1.0.0-beta7 2020-09-24
1.0.0-beta6 2020-09-23
1.0.0-beta5 2020-09-22
1.0.0-beta4 2020-09-21
1.0.0-beta3 2020-09-21
1.0.0-beta2 2020-09-18
1.0.0-beta1 2020-09-15
0.16.2 2020-09-07
0.16.1 2020-09-02
0.16.0 2020-09-01
0.16.0-beta4 2020-08-27
0.16.0-beta3 2020-08-27
0.16.0-beta2 2020-08-26
0.16.0-beta1 2020-08-20
0.16.0-alpha7 2020-08-20
0.16.0-alpha6 2020-08-18
0.16.0-alpha5 2020-08-17
0.16.0-alpha4 2020-08-12
0.16.0-alpha3 2020-08-11
0.16.0-alpha2 2020-08-03
0.16.0-alpha1 2020-08-03
0.15.1 2020-07-31
0.15.0 2020-07-30
0.15.0-alpha1 2020-07-27
0.14.1 2020-07-27
0.14.0 2020-07-20
0.14.0-dev3 2020-05-25
0.14.0-dev2 2020-05-21
0.14.0-dev1 2020-05-08
0.14.0-beta6 2020-07-15
0.14.0-beta5 2020-07-13
0.14.0-beta4 2020-07-08
0.14.0-beta3 2020-07-03
0.14.0-beta1 2020-07-02
0.14.0-alpha9 2020-06-25
0.14.0-alpha8 2020-06-24
0.14.0-alpha7 2020-06-22
0.14.0-alpha6 2020-06-22
0.14.0-alpha5 2020-06-18
0.14.0-alpha4 2020-06-15
0.14.0-alpha3 2020-06-09
0.14.0-alpha2 2020-06-02
0.14.0-alpha14 2020-07-01
0.14.0-alpha13 2020-06-29
0.14.0-alpha12 2020-06-29
0.14.0-alpha11 2020-06-26
0.14.0-alpha10 2020-06-25
0.14.0-alpha1 2020-05-28
0.12.1 2020-06-04
0.12.0 2020-04-20
0.11.4 2020-03-31
0.11.3 2020-03-27
0.11.2 2020-03-11
0.11.1 2020-03-10
0.11.0 2020-03-09
0.10.0 2020-03-08
0.4.1 2020-01-28
0.4.0 2020-01-28
0.3.0 2020-01-28