Last active
August 22, 2019 10:39
-
-
Save Krina28/1a3f7a23e83e1eccdf5d872956fa41c7 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
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