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

v1.8.4

Published

GraphQL Network Communication Framework (Meta)

Downloads

19

Readme

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

GraphQL-IO

GraphQL Network Communication Framework

ATTENTION: This is just a meta-package for GraphQL-IO. Please check out GraphQL-IO-Client and GraphQL-IO-Server for the real client and server implementation packages!

About

This is a GraphQL-based network communication framework for JavaScript clients, running under either Node.js or in the Browser, and JavaScript servers, running under Node.js. The client-side is provided by the module GraphQL-IO-Client, the server-side is provided by the module GraphQL-IO-Server. This is just a meta-package which bundles the server and client packages for being able to conveniently reference both the server and the client in their latest versions through a single package. Feel free to just use (particular versions of) the individual packages directly.

On the client-side, it is based on the GraphQL engine GraphQL.js, the GraphQL client library Apollo Client, its WebSocket network interface Apollo Client WS and the HTTP client library Axios.

On the server-side, 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.

Installation

# all-in-one
$ npm install graphql-io

# client-side only
$ npm install graphql-io-client

# server-side only
$ npm install graphql-io-server

Usage

/*  all-in-one  */
import { Client } from "graphql-io"
import { Server } from "graphql-io"

/*  client-side only  */
import { Client } from "graphql-io-client"

/*  server-side only  */
import { Server } from "graphql-io-server"

For particular usage details, please see the GraphQL-IO-Client package and its GraphQL-IO-Client API and the GraphQL-IO-Server package and its GraphQL-IO-Server API.

Sample

/*  Hello World Server  */
const { Server } = require("graphql-io-server")
const server = new Server({ url: "http://127.0.0.1:12345/api" })
server.at("graphql-resolver", () => ({
    Root: { hello: [ "hello: String", () => "world" ] }
}))
await server.start()
/*  Hello World Client  */
const { Client } = require("graphql-io-client")
const client = new Client({ url: "http://127.0.0.1:12345/api" })
await client.connect()
let result = await client.query("{ hello }")
await client.disconnect()
console.log(result.data)

For more elaborate samples, check out the Samples folder. These samples show a minimum Hello World, subscriptions over separate client connections, real-time performance of server, usage from within Node.js and the Browser, etc.

License

Copyright (c) 2016-2019 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.