Skip to content

Commit c760a37

Browse files
committed
add brief api reference docs for express-graphql
1 parent 8883f4e commit c760a37

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

site/code/index.html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Many different programming languages support GraphQL. This list contains some of
3030
## GraphQL Server Libraries
3131
3232
- [GraphQL.js](/graphql-js/getting-started/) ([github](https://github.com/graphql/graphql-js/)) ([npm](https://www.npmjs.com/package/graphql)): The reference implementation of the GraphQL specification, designed for running a GraphQL server in a Node.js environment.
33-
- [express-graphql](/graphql-js/getting-started/) ([github](https://github.com/graphql/express-graphql)) ([npm](https://www.npmjs.com/package/express-graphql)): The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.
33+
- [express-graphql](/graphql-js/running-an-express-graphql-server/) ([github](https://github.com/graphql/express-graphql)) ([npm](https://www.npmjs.com/package/express-graphql)): The reference implementation of a GraphQL API server over an Express webserver. You can use this to run GraphQL in conjunction with a regular Express webserver, or as a standalone GraphQL server.
3434
- [Graphene](http://graphene-python.org/) ([github](https://github.com/graphql-python/graphene)): A Python library for building GraphQL APIs. Built-in support for [Relay](https://facebook.github.io/relay/), Django, SQLAlchemy, and Google App Engine.
3535
- [graphql-ruby](https://github.com/rmosolgo/graphql-ruby): A Ruby library for building GraphQL APIs. Built-in support for Relay and Rails.
3636
- [graphql-java](https://github.com/graphql-java/graphql-java): A Java library for building GraphQL APIs.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: express-graphql
3+
layout: ../_core/CodeLayout
4+
category: API Reference
5+
permalink: /docs/api-reference-express-graphql/
6+
sublinks: graphqlHTTP
7+
next: /docs/api-reference-graphql/
8+
---
9+
10+
The `express-graphql` module provides a simple way to create an [Express](https://expressjs.com/) server that runs a GraphQL API.
11+
12+
```js
13+
import graphqlHTTP from 'express-graphql'; // ES6
14+
var graphqlHTTP = require('graphql'); // CommonJS
15+
```
16+
17+
### graphqlHTTP
18+
19+
```js
20+
graphqlHTTP({
21+
schema: GraphQLSchema,
22+
graphiql?: ?boolean,
23+
rootValue?: ?any,
24+
context?: ?any,
25+
pretty?: ?boolean,
26+
formatError?: ?Function,
27+
validationRules?: ?Array<any>,
28+
}): Middleware
29+
```
30+
31+
Constructs an Express application based on a GraphQL schema.
32+
33+
See the [express-graphql tutorial](/graphql-js/running-an-express-graphql-server/) for sample usage.
34+
35+
See the [GitHub README](https://github.com/graphql/express-graphql) for more extensive documentation of the details of this method.

site/docs/Guides-ConstructingTypes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Constructing Types
33
layout: ../_core/CodeLayout
44
category: Advanced Guides
55
permalink: /graphql-js/constructing-types/
6-
next: /docs/api-reference-graphql/
6+
next: /docs/api-reference-express-graphql/
77
---
88

99
For many apps, you can define a fixed schema when the application starts, and define it using GraphQL schema language. In some cases, it's useful to construct a schema programmatically. You can do this using the `GraphQLSchema` constructor.

0 commit comments

Comments
 (0)