Skip to content

fix(core): pass invalidationOptions as second argument to invalidateQ… - #7657

Open
Junaidm678 wants to merge 1 commit into
refinedev:mainfrom
Junaidm678:fix/core-invalidate-options-7656
Open

Junaidm678 wants to merge 1 commit into
refinedev:mainfrom
Junaidm678:fix/core-invalidate-options-7656

Conversation

@Junaidm678

Copy link
Copy Markdown

Summary

This PR fixes #7656.

Previously, useInvalidate was incorrectly merging invalidationOptions (like cancelRefetch: false) into the filters object passed to queryClient.invalidateQueries.

TanStack Query v5 expects these options as the second argument. Because they were merged into the filters, the options were being silently ignored, causing in-flight requests to be unnecessarily cancelled when using liveMode: "auto" or rapid invalidations.

The Fix

This fix separates the arguments, passing invalidationOptions correctly as the second parameter to queryClient.invalidateQueries across all invalidation methods (detail, list, many, resourceAll, and all).

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have added a changeset for this fix
  • The @refinedev/core package builds successfully locally

@changeset-bot

changeset-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 90a65b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@refinedev/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] useInvalidate passes invalidationOptions as query filters, so cancelRefetch is ignored

1 participant