Skip to content

Instantly share code, notes, and snippets.

@doug2k1
Created April 20, 2018 23:24
Show Gist options
  • Save doug2k1/df541569c32d8a2ebe6a5de61e747410 to your computer and use it in GitHub Desktop.
Save doug2k1/df541569c32d8a2ebe6a5de61e747410 to your computer and use it in GitHub Desktop.
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