Skip to content

Instantly share code, notes, and snippets.

Created October 8, 2020 10:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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