Fix table editor prefetch (#43083)

## Context

Noticed that the table editor prefetch wasn't working as intended as the
table's rows were getting fetched again when opening the table.

Fix is that `preflightCheck` should've been excluded from the
`table-rows` query key

## To test
Within the Table Editor
- [ ] Verify that `table-rows` is getting prefetched when hovering over
a table in the side menu
- [ ] Verify that `table-rows` doesn't get fetched again when opening
the table subsequently (There shouldn't be a UI loader too - rows should
render immediately)
This commit is contained in:
Joshen Lim authored and GitHub committed 2026-02-23 16:25:03 +08:00
1 parent c0f7e7dfd1
commit 067a95e560
1 file changed
+4 -1
@@ -395,10 +395,13 @@ export const useTableRowsQuery = <TData = TableRowsData>(
) => {
const queryClient = useQueryClient()
// [Joshen] Exclude preflightCheck from query key
const { preflightCheck, ...othersArgs } = args
return useQuery<TableRowsData, TableRowsError, TData>({
queryKey: tableRowKeys.tableRows(projectRef, {
table: { id: tableId },
...args,
...othersArgs,
}),
queryFn: ({ signal }) =>
getTableRows({ queryClient, projectRef, connectionString, tableId, ...args }, signal),