Created
October 1, 2020 14:37
-
-
Save renanregis/80f114f2fbccb9713a3cd1674b0aa04a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const { gql, ApolloServer } = require('apollo-server'); | |
const typeDefs = gql` | |
type Query { | |
greeting: String | |
} | |
`; | |
const resolvers = { | |
Query: { | |
greeting: () => 'Hello GraphQL' | |
} | |
}; | |
const server = new ApolloServer({typeDefs, resolvers}); | |
server.listen({port: 9000}) | |
.then(({url}) => console.log(`Server running at ${url}`)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment