Skip to content

Latest commit

 

History

History
30 lines (23 loc) · 802 Bytes

express-graphql.md

File metadata and controls

30 lines (23 loc) · 802 Bytes
title
express-graphql

The express-graphql module provides a simple way to create an Express server that runs a GraphQL API.

import { graphqlHTTP } from 'express-graphql'; // ES6
var { graphqlHTTP } = require('express-graphql'); // CommonJS

graphqlHTTP

graphqlHTTP({
  schema: GraphQLSchema,
  graphiql?: ?boolean,
  rootValue?: ?any,
  context?: ?any,
  pretty?: ?boolean,
  formatError?: ?Function,
  validationRules?: ?Array<any>,
}): Middleware

Constructs an Express application based on a GraphQL schema.

See the express-graphql tutorial for sample usage.

See the GitHub README for more extensive documentation of the details of this method.