Skip to content

Instantly share code, notes, and snippets.

@ivanstnsk
Created January 10, 2022 12:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanstnsk/4f0a9953cc73f64c3fb7ead72979689f to your computer and use it in GitHub Desktop.
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)
// 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