Skip to content

Mutation query responses may be cached #115

@jerrysu

Description

@jerrysu

Both useMutation and useBulkMutation may end up using cached query responses if the action doesn't change between mutations (e.g., the POST data remains the same). It seems wrong to me that mutations would be cached.

The query function has a skipCache flag that needs to be set on these two lines:

const queryResponse = await clientContext.query<T>({ ...action, signal: action.signal || signal });

const queryResponses: Array<QueryResponse<T>> = await Promise.all(actions.map(action => query<T>(action)));

I'll submit a PR for this after I free up some time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions