- amplify init
- amplify add api (Todos)
- amplify add function (Create and Update permissions to API)
- Modify the schema on the console:
type Todo @aws_api_key @aws_iam {
id: ID!
name: String!
description: String
}
type Mutation @aws_api_key @aws_iam {
createTodo(input: CreateTodoInput!): Todo
updateTodo(input: UpdateTodoInput!): Todo
deleteTodo(input: DeleteTodoInput!): Todo
}
- Lambda Function Code: amplify/backend/function/backendgraphql52d39904/src/index.js
- Add IAM as additional authorization mode
- amplify serve
- Open http://localhost:3000 on a browser, invoke Lambda from the console and receive the new Todo on the frontend