-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs: Add skiptoken example #6856
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
@spookyuser is attempting to deploy a commit to the trpc Team on Vercel. A member of the Team first needs to authorize it. |
@trpc/client
@trpc/next
@trpc/react-query
@trpc/server
@trpc/tanstack-react-query
@trpc/upgrade
commit: |
WalkthroughThe documentation for the TanStack React Query integration was updated to include an example demonstrating how to disable a query in a type-safe manner using the Changes
Poem
β¨ Finishing Touchesπ§ͺ Generate unit tests
πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π Outside diff range comments (1)
www/docs/client/tanstack-react-query/usage.mdx (1)
72-74
: Fix typo:stateTime
βstaleTime
stateTime
isnβt a valid React Query option and will mislead users who copy-paste this snippet.- // Any Tanstack React Query options - stateTime: 1000, + // Any Tanstack React Query options + staleTime: 1000,
π§Ή Nitpick comments (1)
www/docs/client/tanstack-react-query/usage.mdx (1)
96-96
: Hyphenate βtype-safeβ for grammatical clarity-If you want to disable a query in a type safe way, you can use `skipToken`: +If you want to disable a query in a type-safe way, you can use `skipToken`:
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
www/docs/client/tanstack-react-query/usage.mdx
(1 hunks)
π§° Additional context used
π§ Learnings (2)
π Common learnings
Learnt from: heitorlisboa
PR: trpc/trpc#6849
File: examples/minimal-react-typesafe-errors/client/src/Users.tsx:6-6
Timestamp: 2025-06-29T21:21:07.306Z
Learning: In the minimal-react-typesafe-errors example, the `trpc.user.list` query is designed to never throw errors since it's a minimal example focused on demonstrating typed error handling in mutations rather than queries.
www/docs/client/tanstack-react-query/usage.mdx (1)
Learnt from: heitorlisboa
PR: trpc/trpc#6849
File: examples/minimal-react-typesafe-errors/client/src/Users.tsx:6-6
Timestamp: 2025-06-29T21:21:07.306Z
Learning: In the minimal-react-typesafe-errors example, the `trpc.user.list` query is designed to never throw errors since it's a minimal example focused on demonstrating typed error handling in mutations rather than queries.
πͺ LanguageTool
www/docs/client/tanstack-react-query/usage.mdx
[grammar] ~96-~96: There might be a mistake here.
Context: ...If you want to disable a query in a type safe way, you can use skipToken
: ```t...
(QB_NEW_EN_OTHER)
[grammar] ~96-~96: Use proper spacing conventions.
Context: ... type safe way, you can use skipToken
: ts import { skipToken } from '@tanstack/react-query'; const query = useQuery( trpc.user.details.queryOptions( user?.id && project?.id ? { userId: user.id, projectId: project.id, } : skipToken, { staleTime: 1000, }, ), );
The result can be passed to useQuery
o...
(QB_NEW_EN_OTHER_ERROR_IDS_000007)
β° Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Analyze (typescript)
- GitHub Check: Lint and auto-fix
- GitHub Check: build
- GitHub Check: test
π― Changes
Add an example of using a skipToken because I always forget how to do it with the new react query client and then I search google and it's not on google :)
β Checklist
Summary by CodeRabbit
skipToken
with TanStack React Query. This helps clarify conditional query usage while maintaining type safety.