Skip to content

Instantly share code, notes, and snippets.

@Krina28
Last active August 22, 2019 10:39
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 Krina28/1a3f7a23e83e1eccdf5d872956fa41c7 to your computer and use it in GitHub Desktop.
Save Krina28/1a3f7a23e83e1eccdf5d872956fa41c7 to your computer and use it in GitHub Desktop.
var express = require('express');
var { ApolloServer } = require('apollo-server-express');
var graphqlTools = require('graphql-tools');
var typeDefs = require('./src/graphql/schema')
var resolvers = require('./src/graphql/resolver')
var schema = graphqlTools.makeExecutableSchema({ typeDefs, resolvers });
const app = express();
const server = new ApolloServer({ typeDefs, resolvers, playground: true, });
server.applyMiddleware({ app, path: '/graphql' });
app.listen({ port: 3000 }, function () {
console.log('Server started...')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment