erquhartE
Convex Community2y ago
2 replies
erquhart

Graceful error handling in paginated queries

Scenario:
- We have a one-to-many relationship, many Bars to one Foo
- A user is viewing a paginated list of Bars from a Foo id in the url path
- A different user deletes the Foo in question

I expect the change will cause the paginated query to rerun, as the Foo id is an arg for the query.

Is there any problem with returning a fake paginated query result so the list just renders empty? There will be more that happens to gracefully navigate away, but not before that paginated query throws.

I want to avoid using error boundaries for fully expected errors like this.

Fake paginated query result I'm using:

export const emptyPaginatedQueryResult = {
  page: [],
  isDone: true,
  continueCursor: '',
}
Was this page helpful?