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

feat: Support string type for pageParam and nextPageParam options #149

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

Conversation

7nohe
Copy link
Owner

@7nohe 7nohe commented Sep 17, 2024

resolve #146

@7nohe 7nohe self-assigned this Sep 17, 2024
Copy link

github-actions bot commented Sep 17, 2024

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 99.05% (🎯 95%) 2103 / 2123
🟢 Statements 99.05% (🎯 95%) 2103 / 2123
🟢 Functions 100% (🎯 95%) 42 / 42
🟢 Branches 93.57% (🎯 85%) 204 / 218
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/createUseQuery.mts 99.47% 94.5% 100% 99.47% 299-302
Generated in workflow #331

@JonasPf
Copy link

JonasPf commented Sep 26, 2024

I'm running into a problem with initialPageParam here. My api expects no or an empty initial page parameter. initialPageParam="" generates code that sends page=0. I believe the reason is that formatOptions => safeParseNumber converts the empty string to 0.

I can work around it by setting initialPageParam="''" which generates code that sends page=%27%27 which works with my api but it's a bit ugly.

Ideally there would be a omitInitialPageParam parameter that would change it so that no page parameter is send at all.

@7nohe 7nohe added the v1 label Oct 14, 2024
@7nohe 7nohe changed the base branch from main to v1 October 14, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow pageParam to be a string within generated infiniteQueries
2 participants