Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tanstack useQuery, useMutation docs, deprecated custom useQuery #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

amjithtitus09
Copy link

Update Data Fetching Documentation for TanStack Query Migration

Description

Updated the data fetching documentation to reflect our migration from custom hooks to TanStack Query. The new documentation provides clear examples and best practices for using TanStack Query in CARE.

Changes

  • Replaced documentation for deprecated useQuery and useMutation hooks
  • Added examples showing how to use TanStack Query with our existing route definitions
  • Included practical examples for common use cases:
    • Basic data fetching
    • Query parameters
    • Path parameters
    • Mutations (create/update/delete)
    • Dependent queries
  • Added direct links to relevant TanStack Query documentation sections
  • Noted deprecation of legacy hooks

Additional Notes

  • Documentation maintains compatibility with our existing route definition pattern
  • Added links to TanStack docs for advanced features to avoid duplicating their documentation

Migration Guide

For teams migrating from the old hooks:

  1. Replace useTanStackQueryInstead with useQuery from '@tanstack/react-query'
  2. Replace useDeprecatedMutation with useMutation from '@tanstack/react-query'
  3. Follow the examples in the updated documentation for proper query key structure

Copy link

netlify bot commented Dec 12, 2024

Deploy Preview for docs-ohc ready!

Name Link
🔨 Latest commit fb670f0
🔍 Latest deploy log https://app.netlify.com/sites/docs-ohc/deploys/675c37d719d6760008ea0139
😎 Deploy Preview https://deploy-preview-91--docs-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant