In Apollo v4, useLazyQuery's execute function returns a ResultPromise
that can reject on errors (unlike v3 where it resolved with the error
in the result). This caused the first object's list view to stay in
permanent loading after page refresh, because the unhandled rejection
left isRecordTableInitialLoading and isInitializingVirtualTableDataLoading
stuck in their initial states.
Two fixes:
- Add try/catch in findManyRecordsLazy to gracefully handle execute
rejections (matching v3 behavior of returning errors in the result)
- Add try/finally in triggerInitialRecordTableDataLoad to ensure loading
states are always cleaned up regardless of errors
https://claude.ai/code/session_01EA7CMTUTG5zFP132yvUweT