`InMemoryCacheConfig` interface has no `cacheRedirects` property
See original GitHub issueIntended outcome:
I am trying to use cache redirects as recommended in Apollo Client 3.0 documentation and I guess it should work as as in the docs. Or docs should change to match the actual implementation
Actual outcome:
The tsc
complains that InMemoryCacheConfig
has no cacheRedirects
property.
How to reproduce the issue:
Install @apollo/client
at version 3.0.0-beta.37
, follow the documentation, see the error.
Versions
@apollo/client: ^3.0.0-beta.37 => 3.0.0-beta.37
apollo: ^2.23.0 => 2.23.0
apollo-link-error: ^1.1.12 => 1.1.12
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Configuring the Apollo Client cache - Apollo GraphQL Docs
This article describes cache setup and configuration. To learn how to interact with cached data, see Reading and writing data to the cache....
Read more >When to use Apollo's cacheRedirects? - Stack Overflow
It seems obvious and intuitive that given a query like the one below that we're fetching a single Book object by it's id...
Read more >apollo-cache-inmemory@1.6.6 - jsDocs.io
Documentation for npm package apollo-cache-inmemory@1.6.6 - jsDocs.io.
Read more >Configuring the Cache – Angular - GraphQL Code Generator
As of Apollo Client 3.0, the InMemoryCache class is provided by the @apollo/client package. No additional libraries are required.
Read more >Basics of Caching Data in GraphQL Apollo React Client
no -cache policy does not read, nor does it write to the cache with the response. It will always make a request using...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Something like this?
I think the piece you’re missing is
options.toReference
(andoptions.args
perhaps).You don’t necessarily have to pay any attention to
existingDataFromCache
, if this is a purely client-only field, meaning you won’t be writing anyQuery.user
data from the server into the cache:The
cacheRedirects
API has been removed in AC3, since its use cases are much better realized using field policies (and specificallyread
functions that returnReference
objects): https://deploy-preview-5677--apollo-client-docs.netlify.com/docs/react/v3.0-beta/caching/cache-field-behavior/Sorry for the misleading documentation! It’s still a work in progress (hence the “beta” tag), and we will definitely fix this before the final release.