#Graceful error handling in paginated queries

2 messages · Page 1 of 1 (latest)

marble lily
#

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: '',
}
cinder vine
#

No problem, go ahead. I think we have a proposal internally to export this "empty page" as a constant