Last active
August 6, 2019 22:57
-
-
Save stubailo/f6d349a961edb192ee457061b1a96a0e to your computer and use it in GitHub Desktop.
Apollo Server Lambda hello world
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
// src/lambda/graphql.js | |
const { ApolloServer, gql } = require("apollo-server-lambda"); | |
const typeDefs = gql` | |
type Query { | |
hello: String | |
} | |
`; | |
const resolvers = { | |
Query: { | |
hello: (root, args, context) => { | |
return "Hello, world!"; | |
} | |
} | |
}; | |
const server = new ApolloServer({ | |
typeDefs, | |
resolvers, | |
introspection: true, | |
playground: true | |
}); | |
exports.handler = server.createHandler(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @stubailo, thanks for the tutorial!
I'm just working my through and noticed that the requirements to get the playground in
src/lambda/graphql.js
have changed.