Improved hydration when using network-only, cache-and-network, and no-cache fetch policies#89
Improved hydration when using network-only, cache-and-network, and no-cache fetch policies#89jerelmiller wants to merge 22 commits intomainfrom
network-only, cache-and-network, and no-cache fetch policies#89Conversation
|
✅ Changeset file added - thank you! |
| setupFiles: ["./vitest-setup.ts"], | ||
| mockReset: true, | ||
| unstubGlobals: true, | ||
| tags: [ |
There was a problem hiding this comment.
When developing locally, I noticed several of the vite plugin tests that were flaky due to timeout issues. tags were added as a feature in 4.1.0. I've defined them here so we can use them locally and/or commit tests with tags when we need to bump the timeout or have a test retry due to flakiness.
src/mcp/core/ApolloClient.ts
Outdated
There was a problem hiding this comment.
Do we want @prefetch queries to be hydrated queries, or should these just be written to the cache and thats it? If a @prefetch query is marked as network-only for example, should it be fetched again, or should it go through the hydration flow the first time?
@andrewmcgivery would love your thoughts here. Perhaps this rolls into a broader discussion of @prefetch 🙂
094b309 to
05c8a64
Compare
When using fetch policies that bypassed the cache and went to the network, these queries would execute a redundant fetch using the
executetool call. This PR removes that redundancy and will instead serve the tool result that initiated the app the first time the query is executed. After the initial result is served, the fetch policy is honored going forward.