graphql - 是否可以与 Appsync GrapQL 建立内部连接?
问题描述
对于某些情况,我有以下代码:
type Product
@model
@key(name: "byProductCategory", fields: ["productCategoryID", "name"])
@auth(
rules: [
{ allow: groups, groups: ["Driver", "Restaurant"], operations: [read] }
{
allow: groups
groups: ["SuperAdmin"]
operations: [read, create, update, delete]
}
]
) {
id: ID!
productCategoryID: ID!
name: String!
brand: String!
mainImage: Image @connection
images: [Image] @connection(keyName: "byProduct", fields: ["id"])
description: String
category: ProductCategory @connection(fields: ["productCategoryID"])
alternative: [Product]
byproduct: [Byproduct]
}
我想显示产品类型的替代产品列表,但不允许。我尝试制作一个@connection
,但在某些情况下,GrapQL 编译器不允许我在其他情况下看到它,但无法通过 Mutation 插入新的替代方案。还尝试遵循下一个示例。可以查询但不能改变它
https://www.apollographql.com/blog/explaining-graphql-connections-c48b7c3d6976/
解决方案
推荐阅读
- python - 如何从多个类的混淆矩阵中获取真假正负值的标量值?
- python - 如何运行按列值分组的分析,而不是使用整个数据集
- c# - Activate.CreateInstance 的 Noob 问题
- node.js - node.js 中的 Rest api 调用问题
- java - 使用 JSON-B 反序列化 JSON 数组
- css - 如何使内容过度成为剪辑路径形状的 div?
- javascript - 代码返回未定义而不是结果
- python - 在 python 中获取 6 周后的星期一
- python-3.x - 当最大像素值小于 65535 时,如何规范化 uint16 图像并将其转换为 uint8?
- azure - azure dev ops 部署期间的 Azure Web 应用配置设置