【发布时间】:2020-12-10 06:15:48
【问题描述】:
我在 Amplify 中有一个 graphql 模型,如下所示:
type Blog @model @auth(rules: [
{ allow: owner },
{ allow: groups, groups: ["admins"] },
{ allow: public, provider: apiKey, operations: [read] }
]){
id: ID!
title: String!
content: String!
author: String
}
我希望所有字段都可以通过 API 密钥进行读取访问,但“作者”字段除外。它应该只能由所有者和“管理员”组读取。 我已经尝试过各种顶级和字段级@auth 指令的组合,但它不起作用。 有谁知道如何解决这个问题。 谢谢
【问题讨论】:
-
我也有类似的问题.. 你在哪里可以弄清楚如何做到这一点?
标签: graphql authorization aws-amplify