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
import * as path from 'path'; | |
import * as fs from 'fs'; | |
import { ApolloServer } from 'apollo-server' | |
import { makeExecutableSchema } from 'graphql-tools'; | |
import { resolvers } from './src/resolvers'; | |
const userSchema = path.join(__dirname, 'src/user/user.schema.graphql'); | |
const schemaDef = fs.readFileSync(userSchema, 'utf8'); | |
const schema = makeExecutableSchema({ typeDefs: schemaDef }); | |
const server = new ApolloServer({ schema, resolvers }); | |
server.listen().then(({ url }) => { | |
console.log(`🚀 Server ready at ${url}`); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment