MCPcopy Index your code
hub / github.com/simstudioai/sim / invalidateRowCountSurfaces

Function invalidateRowCountSurfaces

apps/sim/hooks/queries/tables.ts:194–200  ·  view source on GitHub ↗

* 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
)

Source from the content-addressed store, hash-verified

192 * rows queries and trigger the very refetch this helper exists to avoid.
193 */
194function 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
202function invalidateTableSchema(queryClient: ReturnType<typeof useQueryClient>, tableId: string) {
203 queryClient.invalidateQueries({ queryKey: tableKeys.detail(tableId) })

Callers 1

useCreateTableRowFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected