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

Aperta
#818 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
graphql, javascript, postgresql
Ambito
api, backend

Direzione di ricerca

Inizia riproducendo il problema con la tabella comments fornita e la subscription edges-only, quindi confrontala con la versione che richiede anche nodes. Traccia come @graphile/subscriptions-lds gestisce le notifiche di eliminazione per queste selezioni. Il lavoro è completo quando la subscription edges-only si aggiorna quando viene eliminata una riga, senza richiedere nodes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

🐛 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
    }
  }
}
Lingua principale
JavaScript
Stelle
764
Fork
128
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di graphile/graphile-engine

Tutte le issue di graphile/graphile-engine

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.