Skip to content

Document how to batch RTK Query mutations properly #2203

Closed
@torhovland

Description

@torhovland

I feel that the documentation needs to cover the following scenario.

I have an array of objects that I need to send to the API. The API only allows mutating one object per request. What is a good way to do this while:

  • avoiding a race condition where the final cache invalidation is ignored because the second to last cache provide comes later.
  • even better, firing just one cache invalidation after all mutations have been sent.

I understand mutations can probably use a queryFn to do this, but the docs only cover how to do multiple fetches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions