added keyfactory for where mutations exist#307
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements query key factories for trainee-profile features as part of standardizing the TanStack Query implementation across the codebase. It centralizes query invalidation logic by moving it from components into mutation hooks, improving maintainability and consistency.
Changes:
- Added query key factory files (
keys.ts) for personal-info, interactions, and tests features - Updated mutation hooks to use key factories for query invalidation
- Removed manual query invalidation from components (TraineeProfile and TestsComponent)
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
client/src/features/trainee-profile/personal-info/data/keys.ts |
New query key factory for trainee personal info with details() method |
client/src/features/trainee-profile/interactions/data/keys.ts |
New query key factory for interactions with list() method |
client/src/features/trainee-profile/education/tests/data/keys.ts |
New query key factory for tests with list() method |
client/src/features/trainee-profile/personal-info/data/useTraineeInfoData.tsx |
Updated to import and use trainee key factory; added query invalidation to mutation |
client/src/features/trainee-profile/interactions/data/interaction-queries.ts |
Updated all mutations to use interaction key factory for invalidation |
client/src/features/trainee-profile/education/tests/data/test-queries.ts |
Updated all mutations to use test key factory for invalidation |
client/src/features/trainee-profile/profile/components/TraineeProfile.tsx |
Removed manual query invalidation and unused queryClient |
client/src/features/trainee-profile/education/tests/TestsComponent.tsx |
Removed manual query invalidation and unused queryClient |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
stasel
approved these changes
Feb 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added a key factory for every feature that invalidates queries
#298