项目作者: rse

项目描述 :
GraphQL Network Communication Framework (Server)
高级语言: JavaScript
项目地址: git://github.com/rse/graphql-io-server.git
创建时间: 2017-06-18T09:49:35Z
项目社区:https://github.com/rse/graphql-io-server

开源协议:

下载


GraphQL-IO |
GraphQL-IO-Client |
GraphQL-IO-Server

GraphQL-IO-Server

GraphQL Network Communication Framework (Server)



About

This is a GraphQL network communication framework for
JavaScript servers, running under Node.js.
It is based on the GraphQL engine GraphQL.js,
the GraphQL schema execution library GraphQL-Tools,
the GraphQL type definition library GraphQL-Tools-Types,
the GraphQL subscription management library GraphQL-Tools-Subscribe,
the network communication framework HAPI,
the WebSocket integration plugin HAPI-Plugin-WebSocket
and the GraphiQL integration plugin HAPI-Plugin-GraphiQL.
It has be used with the corresponding GraphQL-IO-Client
network communication framework on the JavaScript client side.

Installation

  1. $ npm install graphql-io-server

Usage

  1. /* all-in-one */
  2. import { Server } from "graphql-io"
  3. /* client-side only */
  4. import { Server } from "graphql-io-server"

See the TypeScript type definition of the GraphQL-IO-Server API for details.

Sample

  1. /* Hello World Server */
  2. const { Server } = require("graphql-io-server")
  3. const server = new Server({ url: "http://127.0.0.1:12345/api" })
  4. server.at("graphql-resolver", () => ({
  5. Root: { hello: [ "hello: String", () => "world" ] }
  6. }))
  7. await server.start()

For more elaborate samples, check out the Samples folder.

License

Copyright (c) 2016-2019 Dr. Ralf S. Engelschall (http://engelschall.com/)

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.