apollo-server/packages/graphql-server-restify
Jonas Helfer 1e783e550c v1.0.0
2017-06-29 00:05:56 -07:00
..
src allow GraphiQLOptions to be a function and refactor rendering path to reduce duplication 2017-06-13 12:46:06 -04:00
.npmignore Adding in restify integration, docs, tests more... 2016-10-24 11:04:18 -07:00
package.json v1.0.0 2017-06-29 00:05:56 -07:00
README.md Update README for restify 2017-06-29 00:05:56 -07:00
tsconfig.json Do not include types in koa, restify 2017-05-30 18:12:17 -07:00

graphql-server-restify

npm version Build Status Coverage Status Get on Slack

This is the Restify integration of GraphQL Server. GraphQL Server is a community-maintained open-source GraphQL server that works with all Node.js HTTP server frameworks: Express, Connect, Hapi, Koa and Restify. Read the docs.

Principles

GraphQL Server is built with the following principles in mind:

  • By the community, for the community: GraphQL Server's development is driven by the needs of developers
  • Simplicity: by keeping things simple, GraphQL Server is easier to use, easier to contribute to, and more secure
  • Performance: GraphQL Server is well-tested and production-ready - no modifications needed

Anyone is welcome to contribute to GraphQL Server, just read CONTRIBUTING.md, take a look at the roadmap and make your first PR!

Usage

import restify from 'restify';
import { graphqlRestify, graphiqlRestify } from 'graphql-server-restify';

const PORT = 3000;

const server = restify.createServer({
  title: 'GraphQL Server'
});

const graphQLOptions = { schema: myGraphQLSchema };

server.use(restify.bodyParser());
server.use(restify.queryParser());

server.post('/graphql', graphqlRestify(graphQLOptions));
server.get('/graphql', graphqlRestify(graphQLOptions));

server.get('/graphiql', graphiqlRestify({ endpointURL: '/graphql' }));

server.listen(PORT, () => console.log(`Listening on ${PORT}`));