Skip to content

Instantly share code, notes, and snippets.

@LazyFatArrow LazyFatArrow/index.js
Last active Mar 9, 2019

Embed
What would you like to do?
import { resolve } from 'path'
import { mergeTypes, fileLoader } from 'merge-graphql-schemas';
import { ApolloServer, gql } from 'apollo-server'
import resolvers from './resolvers'
const schema = mergeTypes(
fileLoader(resolve(__dirname, './schema'))
)
const apolloOptions = {
typeDefs: gql(schema),
resolvers,
}
new ApolloServer(apolloOptions)
.then((server) => server.listen(4000))
.then(({ url, subscriptionsUrl }) => {
console.log(`🚀 Server ready at ${url}`);
console.log(`🚀 Subscriptions ready at ${subscriptionsUrl}`);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.