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

Đang mở
#818 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
graphql, javascript, postgresql
Lĩnh vực
api, backend

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện vấn đề với bảng comments được cung cấp và subscription edges-only, sau đó so sánh với phiên bản cũng yêu cầu nodes. Theo dõi cách @graphile/subscriptions-lds xử lý các thông báo xóa cho những lựa chọn này. Được xem là hoàn tất khi subscription edges-only cập nhật lúc một hàng bị xóa mà không yêu cầu nodes.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

🐛 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
    }
  }
}
Ngôn ngữ chính
JavaScript
Star
764
Fork
128
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphile/graphile-engine

Tất cả issue của graphile/graphile-engine

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.