Last active
December 10, 2018 20:40
-
-
Save kkworden/b9878cfd280bb62cbd1ee5bfe26542a0 to your computer and use it in GitHub Desktop.
Updated express route to use express-graphql middleware
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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