Open
Description
Describe the bug
When settings the query options with { fetchPolicy: "cache-and-network" }
, the cached result is not instantly returned.
Instead, it waits until the data is fetched from the server to return the result.
To Reproduce
Steps to reproduce the behavior:
- Setup
useQuery
with the following options{ fetchPolicy: "cache-and-network" }
- Setup 2 query variables:
variables1
andvariables2
- Execute the query with
variables1
, thenvariables2
, thenvariables1
again — e.g.const { result } = useQuery(query, variable1, { fetchPolicy: "cache-and-network" })
- On the second time you query with
variables1
, the change inresult
won't be instantaneous. Instead, it will wait for a few seconds before updating.
Expected behavior
The cached result should be returned instantly.
Versions
vue: "^3.2.16"
@vue/apollo-composable: "^4.0.0-alpha.16"
@apollo/client: "^3.5.8"
Metadata
Metadata
Assignees
Labels
No labels