angular - 使用 Amplify Codegen 自定义 GraphQL 查询
问题描述
我正在使用带角度的放大 cli。我已经生成了基于模式的 GraphQL API。我需要编写自定义查询并使用amplify codegen
.
现在,我知道我可以在文件中编写自定义查询src/graphql/**/*.graphql
以仅获取选定的字段,但被调用的底层函数必须已经存在于 schema.json 中 - 例如在下面的代码片段中
query QueryCustom($id:ID!){
getRelationship(id: $id){ <=== this must be present in schema.json
id
sourceId
targetId
}
}
这限制了我能够为查询编写自定义函数(1)以应用基于不同字段的过滤器(例如在上述场景中,基于 sourceId 或 targetId)(2)将我的查询扩展到多个 dynamoDB 表等。
感谢您提供有关如何实现上述(1)和(2)的一些指示
解决方案
推荐阅读
- javascript - 如何让角度前端等待快速 REST-Call 响应
- laravel - 在 Laravel Schedule Job 中使用配置文件
- android - osmdroid 的 mapbox 磁贴中无法识别字体
- dart - 从 Dart 中的另一个未来“值”创建一个未来
- javascript - C# 没有从 Ajax 获取数据
- ffmpeg - 无法使用 FFmpeg 修复具有动态分辨率的 WebM 视频的时间戳
- css - 禁用 align=center on @media
- c - C 在编译时检查数组内容
- javascript - Openlayers 2 + HERE 切片缓存
- powershell - 将excel转成CSV并保存