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

Commit

Permalink
Merge pull request #36 from netlify/addGraphQLTemplate
Browse files Browse the repository at this point in the history
add GraphQL template
  • Loading branch information
swyxio authored Mar 20, 2019
2 parents 99827f8 + 0816d70 commit 53bbfe5
Show file tree
Hide file tree
Showing 4 changed files with 734 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/functions-templates/js/apollo-graphql/apollo-graphql.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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
})

exports.handler = server.createHandler()
Loading

0 comments on commit 53bbfe5

Please sign in to comment.