Skip to content

Instantly share code, notes, and snippets.

@stemmlerjs
Created February 13, 2020 16:39
Show Gist options
  • Select an option

  • Save stemmlerjs/6273cbd670198cc9f92ea97ac758da41 to your computer and use it in GitHub Desktop.

Select an option

Save stemmlerjs/6273cbd670198cc9f92ea97ac758da41 to your computer and use it in GitHub Desktop.
Basic Apollo Server
import { ApolloServer, gql } from 'apollo-server'
const server = new ApolloServer({
typeDefs: gql`
type Query {
hello: String!
}
`,
resolvers: {
Query: {
hello: () => "Hey!"
}
}
});
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