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
.
The defaults are suitable for typical query use, as apps tend to have more queries than mutations.
loadOnMount |
loadOnReload |
loadOnReset |
reloadOnLoad |
resetOnLoad |
✅ |
✅ |
✅ |
❌ |
❌ |
loadOnMount |
loadOnReload |
loadOnReset |
reloadOnLoad |
resetOnLoad |
Situation |
✅ |
✅ |
✅ |
❌ |
❌ |
Display a profile. |
loadOnMount |
loadOnReload |
loadOnReset |
reloadOnLoad |
resetOnLoad |
Situation |
❌ |
❌ |
❌ |
❌ |
✅ |
Login form. |
❌ |
❌ |
❌ |
❌ |
✅ |
Logout form. |
❌ |
❌ |
❌ |
❌ |
❌ |
Change password form. |
❌ |
❌ |
❌ |
✅ |
❌ |
Change name form. |
❌ |
❌ |
❌ |
✅ |
❌ |
Like a post. |
This guide is now maintained in the
graphql-react
readmeuseGraphQL
section: https://github.com/jaydenseric/graphql-react/tree/v8.2.0#function-usegraphql