How to do it...

  1. Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch3/bff-graphql-crud --path cncb-bff-graphql-crud
  1. Navigate to the cncb-bff-graphql-crud directory with cd cncb-bff-graphql-crud.
  1. Review the file named serverless.yml with the following content:
service: cncb-bff-graphql-crudprovider:  name: aws  runtime: nodejs8.10  iamRoleStatements:    ...functions:  graphql:    handler: handler.graphql    events:      - http:          path: graphql          method: post          cors: true    environment:      TABLE_NAME:        Ref: Table  graphiql:    handler: handler.graphiql    ...  trigger:    handler: handler.trigger    events:      - stream:          type: dynamodb          ...resources:  Resources:    Table: Type: AWS::DynamoDB::Table ...

Get JavaScript Cloud Native Development Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.