A GraphQL API created using the Serverless framework using the following tools
- node >= 12
- 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 offlinecommand and simulates the entire API on http://localhost:3000/dev/graphql by default.- Copy/Rename the
.env.exampleto.envand replace theDATABASE_URLwith the database URL.
- Copy/Rename the
-
yarn deploy: Deploy your application viasls deployon AWS Lambda.- Copy/Rename the
.env.exampleto.env.productionand replace theDATABASE_URLwith the database URL and setNODE_ENVto 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 prisma_demo profile but you can pass a custom one using yarn deploy --profile profileName.