Skip to content

Comments

Added invalidating queries on mutations#35

Merged
spietras merged 1 commit intomainfrom
query
Feb 10, 2026
Merged

Added invalidating queries on mutations#35
spietras merged 1 commit intomainfrom
query

Conversation

@spietras
Copy link
Member

No description provided.

@spietras spietras requested a review from Copilot February 10, 2026 19:01
@spietras spietras self-assigned this Feb 10, 2026
@spietras spietras added the feature New feature or request label Feb 10, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces automatic TanStack Query invalidation behavior after successful mutations (with support for mutation meta to control what invalidates/awaits), and slightly refactors locale synchronization query usage.

Changes:

  • Add a MutationCache onSuccess hook to invalidate queries after mutations.
  • Add query-client utility helpers (shouldDehydrateQuery, shouldRedactErrors, invalidateQueriesForMutation) and TS module augmentation for mutation meta (invalidates, awaits).
  • Refactor LocalizationSynchronizer to use the full useQuery result object for data/refetch access.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/src/isomorphic/localization/components/localization-provider/components/localization-synchronizer/main.tsx Refactors locale resolving query usage and refetch trigger on languagechange.
src/src/common/query/lib/create-query-client/utils.ts Adds dehydration helpers and mutation-driven query invalidation utility.
src/src/common/query/lib/create-query-client/main.ts Wires a MutationCache into the app’s QueryClient to invalidate queries on mutation success.
src/src/common/query/augmentations.d.ts Adds TanStack Query module augmentation for typed mutation meta (invalidates, awaits).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@spietras spietras merged commit c2d4ad9 into main Feb 10, 2026
8 checks passed
@spietras spietras deleted the query branch February 10, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant