Skip to content

Instantly share code, notes, and snippets.

@jaydenseric
Last active July 7, 2019 23:45
Show Gist options
  • Save jaydenseric/4186b5b72580a1120e209bb117686b28 to your computer and use it in GitHub Desktop.
Save jaydenseric/4186b5b72580a1120e209bb117686b28 to your computer and use it in GitHub Desktop.
A guide to cache related graphql-react options.

graphql-react options guide

This is a guide to the cache related options for the useGraphQL React hook. The reloadOnLoad and resetOnLoad options also apply to the GraphQL instance method operate.

Defaults

The defaults are suitable for typical query use, as apps tend to have more queries than mutations.

loadOnMount loadOnReload loadOnReset reloadOnLoad resetOnLoad

Queries

loadOnMount loadOnReload loadOnReset reloadOnLoad resetOnLoad Situation
Display a profile.

Mutations

loadOnMount loadOnReload loadOnReset reloadOnLoad resetOnLoad Situation
Login form.
Logout form.
Change password form.
Change name form.
Like a post.
@jaydenseric
Copy link
Author

This guide is now maintained in the graphql-react readme useGraphQL section: https://github.com/jaydenseric/graphql-react/tree/v8.2.0#function-usegraphql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment