[Feature] Query all time-travel versions of an entity as a list

未关闭
#3,480 5 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
graphql
领域
api, backend

调研方向

该 issue 提供了一个用于查询时间旅行版本的 GraphQL 示例,但没有指明文件、测试或实现入口。请先与维护者明确 schema 和存储设计;完成标准应包括一个用于查询实体历史版本的已定义查询,以及覆盖其结果的测试。

由索引模型根据 Issue 内容生成。

描述

area/graphql Stale

Do you want to request a feature or report a bug?
Feature

What is the current behavior?
To query a time-travel version of an entity, you have to specify a block number/hash and you can only query one version at a time.

When you display the history of an entity, you need to store a separate immutable snapshot entity every time the main entity changes. It's a very OK strategy but feels like a waste when behind the scenes there's already a history stored in the database (if I'm not mistaken).

What is the expected behavior?
Enable to query all the time-travel versions of an entity, without any knowledge of blocks the entity changed at. Example of a GraphQL query:

query getBalanceHistory {
  balance(id: "example_id") {
    currentBalance
    timeTravelVersions(first: 10) { # This is a collection on every mutable entity where you can get all the time-travel versions from.
      currentBalance
      blockNumber
    }
  }
}

Why do I need this?
To do historical visualizations of entities (namely balances).

主要语言
Rust
星标
3.2k
派生
1.1k
平均合并
4 天 1 小时
30 天内合并 PR
1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphprotocol/graph-node 的其他 Issue

查看 graphprotocol/graph-node 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。