Skip to content

SuspenseCache / autoDisposeTimeoutMs should be documented #461

@metatick

Description

@metatick

I just spent quite some time scratching my head as to why useSuspenseQuery was unexpectedly returning cached data.

In our case, our graphql server implementation calls out to an unreliable external service, and returns a graphql error if that call fails.

Unmounting/remounting to trigger a "fresh" useSuspenseQuery did not work as anticipated due to the suspense cache, which doesn't appear to be documented anywhere.

I'd suggest documenting:

  1. The fact that the suspense cache exists, what it does, and what it's for
  2. How to configure autoDisposeTimeoutMs

Additionally, perhaps the behavior of the suspense cache should be reconsidered - in my opinion calling useSuspenseQuery with a fetchPolicy of 'network-only', 'no-cache', etc.. should probably do what it says on the tin, rather than there being a whole extra layer of hidden caching involved...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions