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

serverless-cqrs/graphql-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

First, make sure you've run npm i -g serverless and added your AWS credentials.

Deploying for the first time can take 10-20 minutes since it needs to create the ElasticSearch instance.
If there's an error, you may get ROLLBACK_IN_PROGRESS the next time you try to deploy.
Give it a few minutes and then try again.

git clone git@github.com:serverless-cqrs/graphql-example.git
cd graphql-example
npm i
serverless deploy

Once deployed, navigate to the returned endpoint url and you'll see the graphql playground, where you can run the following queries:

mutation {
  addTodo(id: "123", title: "Get Milk")
}
query {
  getById(id: "123") {
    id
    todos {
      title
      completed
    }
  }
}

The AWS Free Tier covers most of these services, but running an ElasticSearch instance on AWS can be expensive.
Make sure to run serverless remove once you're done.