graphql - 需要澄清 GraphQL 全局对象识别规范中描述的根查询类型上的“节点”字段
问题描述
我正在检查 GraphQL 全局对象识别规范并发现以下内容:
To provide options for GraphQL clients to elegantly handle for caching and
data refetching GraphQL servers need to expose object identifiers in a standardized way.
In the query, the schema should provide a standard mechanism for asking for an object by ID.
后来他们提供了要求:
Refetching the object is done with the `node` field on the root query object.
如果我理解正确,他们希望有这样的架构:
type Query {
node(id: ID!)
}
我的问题是:我应该如何理解他们指的是什么对象?我有关系数据库和大量表。我应该扫描它们中的每一个以找到具有该 ID 的对象吗?
或者 id 应该已经包含有关对象类型的信息?
提前致谢。
解决方案
推荐阅读
- java - 如何使用注释根据在 REST 中创建资源的用户授权特定资源
- pgadmin-4 - Postgres 10 和 pgadmin 4 在 ubuntu 18.04 中不起作用
- javascript - javascript,用户点击太快
- c# - C#调用python解释器
- javascript - 比较 2 个不可变列表的相等性
- javascript - 更改 WordPress 联系表 7 中提交按钮的值
- php - 如何在 Visual Studio Code 中使用 Xdebug 在 Ubuntu for Xampp 中调试 PHP 脚本
- react-native - 无法在redux中读取reducers中的属性类型
- javascript - 反应原生动态渲染
- java - 弹簧静态方法