eslint-plugin-enforce-initial-fetch-policy
v1.0.8
Published
An eslint rule to enforce the initial fetch policy of Apollo Client to avoid unexpected caching behavior.
Downloads
11
Readme
Enforce initialFetchPolicy
The Apollo Client currently replaces values of fetchPolicy
when isPolling
is set. This will often lead to unintended caching behavior. Specifying a value of no-cache
for initialFetchPolicy
is the only way to prevent the caching of polled queries. This rule enforces that the initialFetchPolicy
is set when isPolling
is set to make sure the user is aware of the caching behavior.
See: https://github.com/apollographql/apollo-client/blob/72c625d96f172e25563f5bba6e45531abac1deb3/src/core/ObservableQuery.ts#L750-L754