Skip to content

feat: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook#747

Merged
RohitRaj011 merged 37 commits into
developfrom
feat/react-query-setup
Jul 18, 2025
Merged

feat: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook#747
RohitRaj011 merged 37 commits into
developfrom
feat/react-query-setup

Conversation

@RohitRaj011

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

@AbhishekA1509 AbhishekA1509 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should add the recommended eslint plugins as well. https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query

@AbhishekA1509 AbhishekA1509 requested a review from Copilot July 14, 2025 12:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-query dependency and module augmentation for QueryMeta/MutationMeta
  • Introduce QueryClientProvider with global onError toast logic
  • Create wrapper hooks (useQuery, useMutation, re-export useQueryClient)

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-7 to 1.17.0-beta-5 may regress the version order. Verify semver ordering to ensure releases publish in the correct sequence.
    "version": "1.17.0-beta-5",

Comment thread src/Common/API/useQueryClient.ts
Comment thread src/Common/API/useQueryClient.ts
Comment thread src/Common/API/QueryClientProvider.tsx Outdated
Comment thread src/Common/API/useQueryClient.ts
@vivek-devtron vivek-devtron changed the title feat: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook fix: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook Jul 17, 2025
@vivek-devtron vivek-devtron changed the title fix: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook feat: add @tanstack/react-query package, custom QueryClientProvider, useQueryClient hook Jul 17, 2025
Comment thread src/Common/API/CoreAPI.ts
vivek-devtron
vivek-devtron previously approved these changes Jul 18, 2025
@RohitRaj011 RohitRaj011 merged commit 0621ce1 into develop Jul 18, 2025
6 checks passed
@RohitRaj011 RohitRaj011 deleted the feat/react-query-setup branch July 18, 2025 13:30
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.

6 participants