Misleading documentation with regards to `query`'s `fetchPolicy` allowed policies
See original GitHub issueIntended outcome: Set “cache-and-network” when querying directly from the ApolloClient.
Actual outcome: Error message:
Error: cache-and-network fetchPolicy can only be used with watchQuery
How to reproduce the issue:
Follow the documentation here and try to query via client.query(...)
with fetch policy "cache-and-network"
.
Version
- apollo-client@<version number>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:47
- Comments:34 (12 by maintainers)
Top Results From Across the Web
Queries - Apollo GraphQL Docs
This article assumes you're familiar with building basic GraphQL queries. ... This cache-first policy is Apollo Client's default fetch policy.
Read more >Advanced Topics on Caching – Angular
This can be done using the no-cache fetchPolicy . The no-cache policy does not write to the cache with the response.
Read more >Policy API - Okta Developer
The Policy framework is used by Okta to control Rules and settings that govern, among other things, user session lifetime, whether multi-factor authentication ......
Read more >React Apollo: Understanding Fetch Policy with useQuery
Otherwise, Apollo Client executes the query against your GraphQL server and returns that data after caching it. Prioritizes minimizing the ...
Read more >How to implement GraphQL with Flutter + GraphQL example
The queries.dart file contains a queries string document (more on this ... Due to GraphQL's flexibility in regard to retrieving specific ...
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
Is this still a thing?
Any update on this ? This is very strange! I expected the query to return initially from cache and make the request in the meantime then the component will get updated with fresh data!