Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Temetz opened this issue Dec 7, 2022 · 0 comments

Comments

@Temetz
Copy link

Temetz commented Dec 7, 2022

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
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants