apollo-server/packages/apollo-server-restify
2017-10-02 13:39:31 +02:00
..
src Update restify lib (#475) 2017-08-09 13:26:26 +02:00
.npmignore Include src/ directory in published npm packages 2017-08-09 21:09:02 +02:00
package.json Add graphql ^0.11.0 to peerDependencies and remove redundant peerDependencies from server packages 2017-10-02 13:39:31 +02:00
README.md Update restify lib (#475) 2017-08-09 13:26:26 +02:00
tsconfig.json Rename packages from graphql-server- to apollo-server- (#465) 2017-07-17 16:29:40 -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 'apollo-server-restify';

const PORT = 3000;

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

const graphQLOptions = { schema: myGraphQLSchema };

server.use(restify.plugins.bodyParser());
server.use(restify.plugins.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}`));