Skip to content

Instantly share code, notes, and snippets.

@kimobrian
Created February 16, 2018 12:40
Show Gist options
  • Save kimobrian/f6c145d1a215223d862dc146fa1bfa27 to your computer and use it in GitHub Desktop.
Save kimobrian/f6c145d1a215223d862dc146fa1bfa27 to your computer and use it in GitHub Desktop.
A gist describing different tools in the GraphQL ecosystem: apollo-server
import express from 'express';
import bodyParser from 'body-parser';
import { graphqlExpress } from 'apollo-server-express';

let typeDefs = ``;
let resolvers = { /* ... */ };
let executableSchema = /* makeExecutableSchema ... */
const PORT = 3000;

const app = express();

// bodyParser is needed for POST.
app.use('/graphql', bodyParser.json(), graphqlExpress({ schema: executableSchema }));

app.listen(PORT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment