Skip to content
Deploy graphql endpoint written in cljs on AWS lambda using serverless
Clojure
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
api
src/api
.gitignore
README.md
package.json
shadow-cljs.edn

README.md

shadow-cljs-serverless

Demo app, developing cloud infra with shadow-cljs and serverless. It showcases a simple graphql endpoint running as an AWS Lambda function.

Offline development

Note the flag to skip cache invalidation, or else shadow's own hot reloading will cause errors with the offline mode reload:

yarn api:watch
cd api/
sls offline --skipCacheInvalidation

Navigate to http://localhost:4000/graphql and run this test query

{
  getTodos {
    id
    name
  }
}

or using curl:

curl -X POST -H "Content-Type: application/json"  --data \
'{ "query": "{ getTodos { id name } }" }' \
http://localhost:4000/graphql

Prerequisites

Pretty much follow the getting-started guidelines. You need serverless CLI installed:

npm install --global serverless

Login to serverless dashboard. It will gide you through the process if you need to create an account:

serverless login

Deploy

Navigate to dashboard and create new application called serverless-demo. Deploy the application:

yarn api:release
cd api/
sls deploy
You can’t perform that action at this time.