Skip to content

Instantly share code, notes, and snippets.

@kkworden
Last active December 10, 2018 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkworden/b9878cfd280bb62cbd1ee5bfe26542a0 to your computer and use it in GitHub Desktop.
Save kkworden/b9878cfd280bb62cbd1ee5bfe26542a0 to your computer and use it in GitHub Desktop.
Updated express route to use express-graphql middleware
const graphqlHTTP = require('express-graphql');
const schema = require('./schema');
const resolvers = require('./resolvers');
// The rest of our old code...
app.use('/api', graphqlHTTP({
schema: schema,
rootValue: resolvers,
graphiql: true,
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment