Skip to content

Explose refetchQueries for optimistic updates after a mutation #102

Open
@eric-burel

Description

@eric-burel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions