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

Explose refetchQueries for optimistic updates after a mutation #102

Open
eric-burel opened this issue Feb 8, 2022 · 0 comments
Open

Explose refetchQueries for optimistic updates after a mutation #102

eric-burel opened this issue Feb 8, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@eric-burel
Copy link
Collaborator

Is your feature request related to a problem? Please describe.
Apollo now provides a refetchQueries option to refetch queries by name

=> mutations could automatically trigger a refetch of multi and single queries?

However, this pattern is limited:

  • if refetching by name, it only works if you have only one "useMulti" for a given model (however, our current system might also be subject to this limitation? Not sure if we update all relevant queries or just the first found)
  • what happens if the query is not triggered anyway
  • how to update the right "useSingle"?

So it's worth exploring but not sure if it would actually work

https://www.apollographql.com/docs/react/data/mutations/#refetching-queries

@eric-burel eric-burel added the enhancement New feature or request label Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant