docs: Improve ExampleDataService types - #10001
Merged
Merged
Conversation
Mrtenz
reviewed
Aug 28, 2026
| { | ||
| queryKey: [`${this.name}:getActivity`, address], | ||
| initialPageParam: null, | ||
| initialPageParam: null as PageParam, |
Member
There was a problem hiding this comment.
Why do we need a type cast here now?
Member
Author
There was a problem hiding this comment.
It's the simplest way to make the inference work without having to populate the many generic type parameters
FrederikBolding
enabled auto-merge
August 28, 2026 09:05
Mrtenz
reviewed
Aug 28, 2026
|
|
||
| if (pageParam?.after) { | ||
| // eslint-disable-next-line no-restricted-syntax | ||
| if (pageParam && 'after' in pageParam) { |
Member
Author
There was a problem hiding this comment.
Unfortunately not, it doesn't seem to infer properly when the type is a union such as PageParam
Mrtenz
approved these changes
Aug 28, 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.
Explanation
ExampleDataServiceis not type checked, so we had missed some type inference issues. This PR fixes them.References
N/A
Checklist
Note
Low Risk
Test-only example service typing and pagination guards; no production runtime behavior change.
Overview
Updates
ExampleDataService.getActivityso infinite-query types infer correctly once the example is type-checked.fetchInfiniteQueryno longer passes an explicitGetActivityResponsegeneric;initialPageParamisnull as PageParamsoTPageParamlines up withgetPreviousPageParam/getNextPageParam. Pagination branches use'after' in pageParamand'before' in pageParaminstead of optional chaining onpageParam, with eslint disables where the project restricts that syntax.Reviewed by Cursor Bugbot for commit f9f85dc. Bugbot is set up for automated code reviews on this repo. Configure here.