Using Apollo Client 3.6.9 and generated React query hooks (from codegen) I see this strange behaviour where a component uses cache as expected whenever no fetchPolicy is provide (and it's using the default "cache-first" policy), but if I change it to have fetchPolicy "cache-and-network", it totally bypasses the cache when a new component is mounted. With no exception, it renders the first time with no data, and then it renders again with the data, so it's actually equivalent to just doing "network-only", which is not what I'm looking for. I've tried downgrading to other 3.x.x versions of Apollo client to see if it was a temporary glitch, but all versions act the same. Am I missing something here?
Apollo cache-and-network policy always bypasses the cache
208 Views Asked by Knut Marius At
0
There are 0 best solutions below
Related Questions in CACHING
- Using Puppeteer to scrape a public API only when the data changes
- Caching private wordpress rest endpoints
- Cloudflare not respecting Cache-Control
- Unexpected Recursive Call
- Cannot serialize (Spring Boot)
- Nginx only caches file endpoints
- The Selenium application properties folder holds two environment options. After running a test the environment setting changes to a previous setting
- Launch jobs in cache in a loop in bash script
- Multiple async request do not store anything to cache
- Dev tool for Next.js cache on the client?
- Creating a letter in the terminal by entering
- Laravel: check if cache has key with thag
- The retrieval time for the Apache Ignite cache is too long
- How to run gradle with caches files
- Docker Run cache mount does not cache apt-get dependencies
Related Questions in APOLLO-CLIENT
- Error: Response not successful: Received status code 405
- App expo uses useQuery to connect to graphql server, it works in development and when generating apk it works on Android 7 but not on Android 11 or +
- Dealing with Null Values in GraphQL API Response
- Using Apollo client wrapper in Next.js 14 App router
- Upload file in GraphQL and apollo-server
- How to set variables to context.extensions object when execute query?
- React GraphQL mutation is not leaving the loading state
- Apollo GraphQL Kotlin Codegen Fragment Serializable
- GraphQL query in React for Sorare data (running locally)
- GraphQL apollo caching query that has no id
- Wrong data is given from Apollo cache to React because of missing ids
- Getting Bad Request from graphql call
- Call one query and wait for it to finish before calling another one
- Issue with passing "locale" variable in Apollo useQuery and Strapi v4
- Apollo client, merges objects when 'id' propery is empty
Related Questions in REACT-APOLLO
- How to properly catch a canceled request using Apollo Client library
- GraphQL query giving error, but it still updates my database
- GraphQL query in React for Sorare data (running locally)
- Issue with passing "locale" variable in Apollo useQuery and Strapi v4
- Apollo client, merges objects when 'id' propery is empty
- Not All Lazy Queries Polling when using Apollo
- apollo graphql subscription firing two times
- Custom and dynamic headers for different queries React.js Apollo
- Make GraphQL query or mutation arguments a bit more DRY
- Apollo client stopPolling not working after package bump
- Nextjs 13 page router - query response is null after updating invalid access token on a server(ssr)
- how to implement instant comments and replies using graphql apollo
- Implementing Apollo Client for Subscriptions in Next.js
- Unsafe array destructuring of a tuple element with an `any` value using Apollo useQuery
- Uncaught (in promise) ApolloError: Response not successful: Received status code 400
Related Questions in REACT-APOLLO-HOOKS
- What is the better way to handle conditional useQuery calls in apollo client react?
- Apollo MockedProvider Immediately Returns Null
- How to best store data locally - useMutation vs writeQuery
- how can I supply a a variable to a query that can be used to specify a field to sort a returned array by?
- How to write useMutation hook with onCompleted as a parameter?
- cache.writeData is not a function -> inMemoryCache error
- Apollo cache-and-network policy always bypasses the cache
- Does useQuery refetch invalidates cache?
- Apollo client useQuery makes additional call with the first page on every fetchMore call
- Apollo Client can't fetch data, because "Failed to parse source map from invariant.ts"
- Unit testing Apollo useMutation onCompleted
- apollo-client transforms response
- React Apollo (GraphQL): How to stop Query component from re-fetching on each state change
- Apollo Client useQuery react hook for GET requests
- Apollo Client - Separating paginated queries for same field name but with different filters
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?