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

fix: Use optional query keys also without parameters #116

Merged
merged 1 commit into from
May 18, 2024

Conversation

mmurto
Copy link
Contributor

@mmurto mmurto commented May 16, 2024

The query key functions for queries that don't take in additional request parameters don't allow for using additional query key input, but query hooks always take in a query key parameter. This leads to the query key parameter in hooks without additional input being unused variable, leading to TypeScript erroring. Fix this by always taking query key parameter in query key functions, and always using it in query hooks.

Fixes #112.

The query key functions for queries that don't take in additional request
parameters don't allow for using additional query key input, but query
hooks always take in a query key parameter. This leads to the query key
parameter in hooks without additional input being unused variable, leading
to TypeScript erroring. Fix this by always taking query key parameter in
query key functions, and always using it in query hooks.

Fixes 7nohe#112.

Signed-off-by: Mikko Murto <[email protected]>
@seriouslag
Copy link
Collaborator

Thank you for the PR, this looks great!

Copy link
Owner

@7nohe 7nohe left a comment

Choose a reason for hiding this comment

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

Thanks!

@7nohe 7nohe merged commit 0ae3d77 into 7nohe:main May 18, 2024
4 checks passed
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.

"error TS6133: 'queryKey' is declared but its value is never read" from queries.ts and suspense.ts
3 participants