Amazon 使用 Amplify AWS IOS 将多个表连接到一个 API
Amazon Connect many tables to one API with Amplify AWS IOS
我是亚马逊服务 AWS 的新手,我正在尝试为我的项目 (DynamoDB) 创建一个数据库。我已按照教程进行操作并已全部安装(CLI、Amplify 等)。但是当我添加一个新的 API 时,它只会创建一个 table 和方案。所以我的问题是,如何使用相同的 API 拥有多个 table(用户、通知、促销等)?或者我该怎么做?
谢谢!
很确定,如果您的 schema.graphql
中有多个 @model
注释,您将有多个表。例如,
type User @model {
id: ID!
name: String!
}
type Notification @model {
id: ID!
content: String!
}
type Promo @model {
id: ID!
content: String!
}
它将至少创建 3 个表,每个表一个。为什么?因为@model
。阅读 https://aws-amplify.github.io/docs/cli/graphql#usage
我是亚马逊服务 AWS 的新手,我正在尝试为我的项目 (DynamoDB) 创建一个数据库。我已按照教程进行操作并已全部安装(CLI、Amplify 等)。但是当我添加一个新的 API 时,它只会创建一个 table 和方案。所以我的问题是,如何使用相同的 API 拥有多个 table(用户、通知、促销等)?或者我该怎么做?
谢谢!
很确定,如果您的 schema.graphql
中有多个 @model
注释,您将有多个表。例如,
type User @model {
id: ID!
name: String!
}
type Notification @model {
id: ID!
content: String!
}
type Promo @model {
id: ID!
content: String!
}
它将至少创建 3 个表,每个表一个。为什么?因为@model
。阅读 https://aws-amplify.github.io/docs/cli/graphql#usage