* Invalidate only the row-count surfaces — the table detail and the tables * list, both of which carry the unfiltered `rowCount`. Deliberately leaves * `rowsRoot` (the rows infinite query) untouched so an offset-paginated refetch * can't resolve late and clobber rows already spliced in optimistic
( queryClient: ReturnType<typeof useQueryClient>, tableId: string )
| 192 | * rows queries and trigger the very refetch this helper exists to avoid. |
| 193 | */ |
| 194 | function invalidateRowCountSurfaces( |
| 195 | queryClient: ReturnType<typeof useQueryClient>, |
| 196 | tableId: string |
| 197 | ) { |
| 198 | queryClient.invalidateQueries({ queryKey: tableKeys.detail(tableId), exact: true }) |
| 199 | queryClient.invalidateQueries({ queryKey: tableKeys.lists() }) |
| 200 | } |
| 201 | |
| 202 | function invalidateTableSchema(queryClient: ReturnType<typeof useQueryClient>, tableId: string) { |
| 203 | queryClient.invalidateQueries({ queryKey: tableKeys.detail(tableId) }) |