Created
April 20, 2018 23:24
-
-
Save doug2k1/df541569c32d8a2ebe6a5de61e747410 to your computer and use it in GitHub Desktop.
This file contains 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 { graphqlExpress } = require('apollo-server-express'); | |
const { makeExecutableSchema } = require('graphql-tools'); | |
const { importSchema } = require('graphql-import'); | |
const resolvers = require('./graphql/resolvers'); | |
const setup = app => { | |
const schema = makeExecutableSchema({ | |
typeDefs: importSchema('src/graphql/schema.graphql'), | |
resolvers | |
}); | |
// graphql endpoint | |
app.use('/graphql', graphqlExpress({ schema })); | |
}; | |
module.exports = setup; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment