Examples of GraphQL backends for serverless platforms
Switch branches/tags
Clone or download
Latest commit f0fa29c Dec 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_assets move assets folder outside Dec 5, 2018
aws-go combine steps Dec 5, 2018
aws-nodejs combine steps Dec 5, 2018
aws-python combine steps Dec 5, 2018
cloudformation restructure directories Nov 30, 2018
schema restructure directories Nov 30, 2018
README.md add heading Dec 5, 2018
using-with-hasura.md add using with hasura docs Dec 5, 2018

README.md

GraphQL Serverless

GraphQL backend boilerplates that can be deployed on serverless platforms.

In theory, GraphQL and Serverless are supposed to work well together. Serverless gives a scalable and no-ops platform to deploy a GraphQL backend instantly. Although in practice, there are few reasons why this may not work:

  1. Serverless is new:

Development, testing and deployment mechanisms on serverless are not mature. Although there are few tools out there which ease out some of the processes, these tools are rapidly changing.

  1. Managing state in serverless:

Serverless backends cannot hold state between different requests. This means the state must be created and destroyed in each serverless request which becomes a bottleneck. In the case of GraphQL backend, a database connection must be created in each request which quickly exhausts the database limits.

The only way to solve these problems are:

  1. Setup a simple development/deployment workflow on serverless which is reliable.
  2. Setup a connection pool for managing database connections in serverless backends.

Getting Started

The boilerplates in this repo provide sample source code for building GraphQL backends while solving the above problems:

Get started with the following languages and serverless platforms:

NodeJS + AWS Lambda

Python + AWS Lambda

Go + AWS Lambda

Using with Hasura GraphQL Engine (Optional)

While you can use these boilerplates to create any kind of GraphQL schema, you may wish to merge your schema with Hasura GraphQL Engine to augment your schema with a wide range of CRUD APIs.

Follow this guide to merge your schema with Hasura: using-with-hasura.md