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

V2: Replace disableQuery with skipToken #428

Conversation

timostamm
Copy link
Member

@timostamm timostamm commented Sep 27, 2024

TanStack query added skipToken - we can use it instead of disableQuery.

...baseOptions,
...queryOptions,
Copy link
Member Author

Choose a reason for hiding this comment

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

This change accepts all TanStack Query options, even if they override an option provided by us. The types are changed to allow all options.

queryFn and queryKey are still typed, since the option type is not inferred.

Copy link
Member Author

Choose a reason for hiding this comment

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

@paul-sachs, I've reverted the change to the types in 786fde4.

This means we do not allow overriding computed options with this PR. We can still merge the users options into our options in the hooks because TanStack Query honors the skipToken on it's own and we don't have to set enabled: false. We can allow overriding later if needed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to me, might as well keep them in separate PRs anyways.

timostamm and others added 4 commits September 30, 2024 14:49
Signed-off-by: Timo Stamm <ts@timostamm.de>
…leQuery-with-skipToken,-allow-overriding-computed-options
Enabling typechecking tests with vitest.

---------

Signed-off-by: Paul Sachs <psachs@buf.build>
…ableQuery-with-skipToken,-allow-overriding-computed-options

Signed-off-by: Timo Stamm <ts@timostamm.de>
@timostamm timostamm force-pushed the tstamm/v2/Replace-disableQuery-with-skipToken,-allow-overriding-computed-options branch from c9104be to fdd0eba Compare September 30, 2024 14:56
…leQuery-with-skipToken,-allow-overriding-computed-options
Signed-off-by: Timo Stamm <ts@timostamm.de>
@timostamm timostamm changed the title V2: Replace disableQuery with skipToken, allow overriding computed options V2: Replace disableQuery with skipToken Sep 30, 2024
@timostamm timostamm merged commit c9f20cd into v2 Sep 30, 2024
5 of 8 checks passed
@timostamm timostamm deleted the tstamm/v2/Replace-disableQuery-with-skipToken,-allow-overriding-computed-options branch September 30, 2024 16:00
@timostamm timostamm mentioned this pull request Oct 9, 2024
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.

2 participants