Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

lnmunhoz/nestjs-graphql-serverless

Open more actions menu

Repository files navigation

NestJS GraphQL Serverless

Boilerplate for using NestJS with GraphQL (Code-First) on serverless environment (AWS Lambda)

Follow the discussion: nestjs/docs.nestjs.com#96

Installation

$ yarn

Running the app

# development
$ yarn start:dev

# serverless-offline
$ yarn start:sls

# deploy
$ yarn deploy:sls

Notes

Developmet Workflow

There's two entrypoints for the server.

  • src/serverless is where the handler function is exported for aws lambda
  • src/main is for local development

You can develop your app using yarn start:dev command, which will run the local nodejs server and regenerate your schema.gql file when update the resolvers.

For development with serverless-offline, you can run yarn start:sls.

Deployment

When your function is deployed, you can access <lambda-url>/dev/graphql to test with the playground, make sure that your GraphQL Playground points to <lambda-url>/dev/graphql instead of <lambda-url>/graphql, otherwise you'll get 403 Forbidden response.

License

MIT

About

Boilerplate for using NestJS with GraphQL (Code-First) on serverless environment (AWS Lambda)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 27

Morty Proxy This is a proxified and sanitized view of the page, visit original site.