Created
October 8, 2020 10:50
-
-
Save velotiotech/0cfa098b7a7ab8898da707d1fd29d1f7 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
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