Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support no-cache requests #2934

Merged
merged 1 commit into from
Feb 1, 2018
Merged

support no-cache requests #2934

merged 1 commit into from
Feb 1, 2018

Conversation

jbaxleyiii
Copy link
Contributor

This PR seeks to support a new FetchPolicy called no-cache. Unlike network-only (which has a somewhat confusing name I admit), this policy bypasses reads AND writes when interacting with the client. So it can be used to "turn off caching" when needed. This applies to mutations as well which now support using FetchPolicy but only for this use case (will throw otherwise)

@apollo-cla
Copy link

Warnings
⚠️

There are library changes, but not tests. That's OK as long as you're refactoring existing code

Messages
📖

Please add your name and email to the AUTHORS file (optional)

Generated by 🚫 dangerJS

@dennislaupman
Copy link

if I add the "no-cache" de returning data is undefined:

export default graphql(HomeViewQuery, {
	options: () => ({ 
		variables: { type: 'dailycatch' }, 
	  	fetchPolicy: 'no-cache',  
	}) 
})(home);

@quentin-
Copy link
Contributor

Should this be marked as a breaking change in the changelog?
Calling mutation with a fetchPolicy used to be ignored, but will now throw an error.

@jamesplease
Copy link

@jbaxleyiii if you're bored in quarantine I'm curious to know what you might choose to name these options (i.e. "network-only", which you described as confusing above) if you didn't need to think about backwards compatibility!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants