Skip to content

Instantly share code, notes, and snippets.

@lindenmelvin
Created Feb 11, 2020
Embed
What would you like to do?
const { ApolloServer, gql } = require('apollo-server');
const resolvers = require("./resolvers");
const typeDefs = gql`
type Post {
title: String!
authorId: String!
}
type Query {
posts: [Post!]!
}
`;
const server = new ApolloServer({
typeDefs,
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