Ben*_*nck 2 amazon-web-services amazon-cognito aws-appsync aws-amplify
我正在使用 AWS Amplify,我想知道最好将用户属性存储为自定义 Cognito 属性还是 AppSync 的用户表?
'username': 'jdoe',
'password': 'mysecurepassword#123',
'attributes': {
'email': 'me@domain.com',
'phone_number': '+12135555555',
'custom:favorite_flavor': 'Cookie Dough' // custom attribute, not standard
}
Run Code Online (Sandbox Code Playgroud)
type User
@model
@auth(
rules: [
{allow: owner, ownerField: "owner", operations: [create, update, delete, read]},
])
{
id: ID!
owner: String
favoriteFlavor: String
}
Run Code Online (Sandbox Code Playgroud)
如果 AppSync 方法是最好的,其他字段是否应该保留到表中(例如姓名或电子邮件)?
谢谢!
根据我的经验,两者都使用是最好的。
希望这对你有帮助。
| 归档时间: |
|
| 查看次数: |
765 次 |
| 最近记录: |