Introducing GraphQLHub-Schemas

Use Popular APIs with GraphQL, now on NPM

Clay Allsopp
Mar 11, 2016 · 1 min read
Image for post
Image for post
Logo by Nate Murray!

I started GraphQLHub because people wanted to learn about GraphQL and Relay without needing their own server. The project has been open-source almost from the get-go, but using the GraphQLHub code on your own wasn’t really possible — until now!

The GraphQLHub-Schemas NPM package contains the GraphQL code to connect to Reddit, Twitter, Github, and more. Here’s how you can use it:

$ npm i graphql graphqlhub-schemas --saveimport { 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);
});

And if you want to explore the schemas right now, you can always use GraphQLHub. If you have feature requests or run into problems, don’t be afraid to drop an issue on Github.


GraphQLHub has seen awesome community contributions over the past few months and I’m excited to see it grow.

Publishing the schemas on NPM is a great step in making GraphQL more accessible — and there’s more to come :)

To stay updated on GraphQL and GraphQLHub, follow @GraphQLHub on Twitter or my posts here on Medium

The GraphQLHub

Writing about GraphQL from GraphQLHub.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store