Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including graphqlhub-schemas with all npm packages installed. Try it out:

require("graphql/package.json"); // graphql is a peer dependency. var graphqlhubSchemas = require("graphqlhub-schemas")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

graphqlhub-schemas v0.1.0

GraphQL Schemas for REST APIs like Github, Hacker News, Reddit, and Twitter

graphqlhub-schemas

A collection of GraphQL schemas for existing HTTP APIs.

Usage

$ npm i graphqlhub-schemas --save

import { Reddit } from 'graphqlhub-schemas';
import { GraphQLSchema, graphql } from 'graphql';

let schema = new GraphQLSchema({
  query: Reddit.QueryObjectType
});

let query = ' { user(username: "kn0thing") { username } } ';
graphql(schema, query).then((result) => {
  console.log(result);
});

Available schemas

Each schema file exports an object that looks like:

import { <Schema> as Schema } from 'graphqlhub-schemas';

let { QueryObjectType } = Schema;
// QueryObjectType is an instance of GraphQLObjectType

See src/index.js from available schemas.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free