Created
January 10, 2022 12:01
-
-
Save ivanstnsk/4f0a9953cc73f64c3fb7ead72979689f to your computer and use it in GitHub Desktop.
Apollo server setup valid on 10 Jan 2022 (for the course https://www.linkedin.com/learning/learning-graphql-11292553)
This file contains 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
// Requires extra step: install the package apollo-server-core | |
const { ApolloServer, gql } = require('apollo-server'); | |
const { ApolloServerPluginLandingPageGraphQLPlayground } = require('apollo-server-core'); | |
const typeDefs = gql` | |
type Query { | |
totalDays: Int! | |
} | |
`; | |
// const resolvers = { | |
// }; | |
const server = new ApolloServer({ | |
typeDefs, | |
mocks: true, | |
plugins: [ | |
ApolloServerPluginLandingPageGraphQLPlayground(), | |
] | |
// resolvers, | |
}); | |
server.listen().then(({ url }) => { | |
console.log('server running on ', url); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment