A GraphQL API created using the Serverless framework using the following tools
- node >= 10
- yarn (recommended) or npm
-
yarn db:save
: Run this command at the start of the project to generate the migrations for your Prisma model located inprisma/schema.prisma
-
yarn db:migrate
: Run this command to add your migrations to the database. -
yarn dev
: Runs the server in development mode via thesls offline
command and simulates the entire API on http://localhost:3000/dev/graphql by default.- Copy/Rename the
.env.example
to.env
and replace theDATABASE_URL
with the database URL.
- Copy/Rename the
-
yarn deploy
: Deploy your application viasls deploy
on AWS Lambda.- Copy/Rename the
.env.example
to.env.production
and replace theDATABASE_URL
with the database URL and setNODE_ENV
to production (this is required for Nexus to not generate artifacts).
- Copy/Rename the
Note: AWS Access and Secret keys must be configured via aws configure
using the aws-cli. The setup uses the default
profile but you can pass a custom one using yarn deploy --profile profileName
.