You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I chose to use apollo-client for my Nodejs build scripts, basically retrieving the latest release from a Github repository and pushing new releases.
I like the architecture of the module where different concerns are separated and pluggable (network protocol, caching implementation, etc.), but I find it strange that caching is mandatory, while at the same time the policy option for no-cache is available. What about treating undefined apollo-clientcache option as if no-cache policy is on ?
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
const client = new ApolloClient({
link: new HttpLink(),
cache: null // 👌will result in `no-cache` default options for both `query` and `watchQuery`.
})
With "@apollo/client": "3.0.0-beta.41",, is there any way to turn the cache off? I've gone through the docs pretty diligently but there's no mechanism like there was with with boost. With boost, you weren't required to provide the cache property to ApolloClient and if you just omitted it entirely, the cache appeared to be skirted entirely.
Motivation
Working with a cache is non-trivial and not something that many development teams need to battle with when they do not have a strong requirement around request caching. Cache invalidation is a whole ordeal that adds substantial layers of complexity to this library that many development teams would like to avoid until they actually need caching.
I've encountered dozens of bugs with onComplete and notifyOnNetworkStatusChange: true that are all related to the cache.
I dont mind helping contribute back and put together a PR to disable it and add the appropriate documentation in Configuring the Cache, but before doing so I'd like to spark a conversation and see where the team is at and if there is anything WIP.
I'm not quite clear on why defaultOptions were collapsed to no longer include watchQuery, query, and mutation props? The current object is the following:
Hi, I chose to use
apollo-client
for my Nodejs build scripts, basically retrieving the latest release from a Github repository and pushing new releases.I like the architecture of the module where different concerns are separated and pluggable (network protocol, caching implementation, etc.), but I find it strange that caching is mandatory, while at the same time the policy option for
no-cache
is available. What about treating undefinedapollo-client
cache
option as ifno-cache
policy is on ?Current implementation:
Suggested implementation:
Versions:
The text was updated successfully, but these errors were encountered: