feat: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook#747
Merged
Conversation
…useQueryClient hook
AbhishekA1509
left a comment
Member
There was a problem hiding this comment.
We should add the recommended eslint plugins as well. https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query
…ib into feat/react-query-setup
There was a problem hiding this comment.
Pull Request Overview
This PR integrates the @tanstack/react-query library, adds module augmentation for error‐toast metadata, and provides a central QueryClientProvider and custom hooks (useQuery, useMutation, useQueryClient) with default error handling.
- Add
@tanstack/react-querydependency and module augmentation forQueryMeta/MutationMeta - Introduce
QueryClientProviderwith global onError toast logic - Create wrapper hooks (
useQuery,useMutation, re-exportuseQueryClient)
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.ts | Import and augment React Query types for error metadata |
| src/Common/API/useQueryClient.ts | Implement custom useQuery, useMutation, and export client hook |
| src/Common/API/index.ts | Export QueryClientProvider and hooks |
| src/Common/API/QueryClientProvider.tsx | Define shared QueryClientProvider with default options and error handlers |
| package.json | Add @tanstack/react-query & ESLint plugin, bump version |
| .eslintrc.cjs | Enable @tanstack/query ESLint plugin |
Comments suppressed due to low confidence (2)
src/Common/API/QueryClientProvider.tsx:1
- There are no tests covering the new
QueryClientProvider. Consider adding unit or integration tests to verify default options and onError behavior.
import { PropsWithChildren } from 'react'
package.json:3
- Switching from
1.17.0-pre-7to1.17.0-beta-5may regress the version order. Verify semver ordering to ensure releases publish in the correct sequence.
"version": "1.17.0-beta-5",
…ib into feat/react-query-setup
…ib into feat/react-query-setup
vivek-devtron
previously approved these changes
Jul 18, 2025
chore(version): bump to 1.18.0
chore: error layout fix
chore: merge rc-v0.40.0
…into feat/react-query-setup
vivek-devtron
approved these changes
Jul 18, 2025
arunjaindev
approved these changes
Jul 18, 2025
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.
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Type of change
Checklist