django - 有没有办法在 1 个查询中通过 id/pk/some 查找进行查询,而不是过滤所有节点并使用 id?
问题描述
https://github.com/graphql-python/graphene-django/issues/349 http://docs.graphene-python.org/projects/django/en/latest/tutorial-relay/
这会查询所有成分,然后使用上一个查询获取特定成分。这是中继/石墨烯中的正常设计模式还是可以在 1 个查询中完成?
query {
allIngredients {
edges {
node {
id,
name
}
}
}
}
query {
# Graphene creates globally unique IDs for all objects.
# You may need to copy this value from the results of the first query
ingredient(id: "SW5ncmVkaWVudE5vZGU6MQ==") {
name
}
}
解决方案
推荐阅读
- sql-server - 将级别列转换为父 ID
- gremlin - Gremlin Python:查询的响应不同
- node.js - 截至 2021 年 6 月 17 日,Google Analytics(分析)UA Measurement Protocol 事件无法在多个媒体资源中运行
- c# - XML 反序列化因嵌套类(内部类)而失败
- node.js - 如何获取对特定消息做出反应的用户的不和谐 ID discord.js
- javascript - 在 AR 快速查看中禁用即时 AR 放置
- gd - GD:服务器上的图像质量低于本地服务器
- javascript - 为什么当我更新父数组中的嵌套数组而其他子数组收到相同的值时?
- apache - 将多个 .htaccess 重写规则合并到一行中?
- sql - 使用 Typescript 从 Codemirror 调用 SQL linter 的 API