graphile/subscriptions-lds does not trigger on DELETE if subscription contains only edges

未关闭
#818 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
graphql, javascript, postgresql
领域
api, backend

调研方向

首先,使用提供的 comments 表和仅包含 edges 的 subscription 重现该问题,然后将其与同时请求 nodes 的版本进行比较。跟踪 @graphile/subscriptions-lds 如何处理这些选择的删除通知。当删除一行时,仅包含 edges 的 subscription 能够更新,且不需要 nodes,即表示完成。

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

描述

🐛 bug help wanted
Summary

If the subscription contains only edges, the subscription doesnt provide live updates for delete.
For create and update this works as expexted.

Steps to reproduce
  • If we have the following database table:
  CREATE TABLE comments (id INTEGER PRIMARY KEY AUTOINCREMENT, content TEXT);
  • The follwing subscription will ONLY get updates on row insert and update:
subscription Comment {
  allComemnts {
    edges {
      id
      content
    }
  }
}
  • However adding the nodes section (with any column in the table) will allow row delete notifications:
subscription Comment {
  allComments {
    nodes {
      id
    }
    edges {
     id
     content
    }
  }
}
Expected results

When row is deleted subscription data should update even if query contains only edges.

Actual results

Row deletion does not update the data, unless nodes section is specified.

Additional context
  • Postgres: 14
  • postgraphile: 4.12.11
  • @graphile/subscriptions-lds: 4.12.3
Possible Solution

As a workaround you can define any column in the nodes section, like so. This will allow you to get updates on row deletes.

subscription Comment {
  allComments {
    nodes {
      id
    }
    edges {
     id
     content
    }
  }
}
主要语言
JavaScript
星标
764
派生
128
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

graphile/graphile-engine 的其他 Issue

查看 graphile/graphile-engine 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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