我有一个使用 google federate 登录的 AWS Amplify 应用程序。这是我的数据模型。
type TriadeMetric @model @auth(rules: [{allow: owner}]) {
id: ID!
NoteMetrics: [NoteMetric] @hasMany(indexName: "byTriadeMetric", fields: ["id"])
}
enum MetricEnum {
ACCURACY
DURATION
}
type NoteMetric @model @auth(rules: [{allow: owner}]) {
id: ID!
metricType: MetricEnum
value: Float
triademetricID: ID! @index(name: "byTriadeMetric")
semitones: Int
}
Run Code Online (Sandbox Code Playgroud)
当我尝试使用创建新记录时
const triadeMetric = await DataStore.save(new TriadeMetric({}));
Run Code Online (Sandbox Code Playgroud)
我收到此警告消息:
[{"errorType":"Unauthorized","message":"Not Authorized to access onCreateTriade on type Triade"}]}
和这个错误:
{"errors":[{"errorType":"Unauthorized to access onCreateTriade on type Triade"}]}
aws-amplify ×1