Skip to content
This repository was archived by the owner on Sep 12, 2019. It is now read-only.

Commit 53bbfe5

Browse files
authored
Merge pull request #36 from netlify/addGraphQLTemplate
add GraphQL template
2 parents 99827f8 + 0816d70 commit 53bbfe5

File tree

4 files changed

+734
-0
lines changed

4 files changed

+734
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { ApolloServer, gql } = require('apollo-server-lambda')
2+
3+
const typeDefs = gql`
4+
type Query {
5+
hello: String
6+
}
7+
`
8+
9+
const resolvers = {
10+
Query: {
11+
hello: (root, args, context) => {
12+
return 'Hello, world!'
13+
}
14+
}
15+
}
16+
17+
const server = new ApolloServer({
18+
typeDefs,
19+
resolvers
20+
})
21+
22+
exports.handler = server.createHandler()

0 commit comments

Comments
 (0)