0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/react/guides
Jaaneek 77d5b2eaec
feat: add typesafe query disabling via skipToken (#6999)
* feat: add typesafe react-query disabling via skipToken

* feat: add unique identifier to skip token

* feat(query-core): implement skipToken

* chore(query-core): refactor logic of skipToken

* feat(react-query): do not allow skipToken in useSuspenseQuery

* feat(react-query): handle skip token in suspense react queries, add tests

* refactor(query-core): remove check for queryFn === skipToken, enabled is set to false instead

* refactor(query-core): remove check for queryFn === skipToken, enabled is set to false instead

* chore(react-query): remove unused imports

* fix(react-query): update test to display error message in error boundary

* fix(query-core): reduce bundle size by using Symbol() instead of Symbol.for

* fix(query-core): move check for skipToken into already existing if statement

* refactor(query-core): remove no longer needed check for skipToken

* refactor(query-core): make sure enabled===true takes precendence over skipToken

* refactor(react-query): remove unnecesary check for skipToken

* feat: bring back logging in dev mode

* docs: use `skipToken` in TypeScript examples

* refactor: remove checks that shouldn't be necessary because we now assign `enabled` in `defaultQueryOptions`

* types: adjust useQueries types in non-react adapters

* fix: infiniteQueryBehavior needs to _create_ a function that rejects if we have a skipToken, not reject right away

* refactor: flip condition

* try to fix query options

* fix: make core compilable

* fix: allow skipToken on type level for useSuspenseQuery and warn at runtime

it won't work anyways

* test: dataTag + skipToken

* chore: remove a test that doesn't make much sense

* chore: solid tests

* chore: stabilize test

* rewrite test

* test(react-query): remove not needed doNotExecute from test, test-d.tsx files are not executed anyway

* docs(react-query): add example of skipToken into react-query disabling-queries docs

* docs: update disabling queries examples in Angular, React, and Vue guides

* docs: add description of skipToken to typescript.md

* test(react-query): add unique queryKey to should respect skipToken test

* test(react-query): use helper function instead of string in should respect skipToken test

---------

Co-authored-by: Dominik Dorfmeister <office@dorfmeister.cc>
History 2024-03-05 15:55:01 +01:00
..
advanced-ssr.md docs(react-query): fix typo supsends -> suspends (#6998) 2024-03-03 10:43:06 +01:00
background-fetching-indicators.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
caching.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
default-query-function.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
dependent-queries.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
disabling-queries.md feat: add typesafe query disabling via skipToken (#6999) 2024-03-05 15:55:01 +01:00
does-this-replace-client-state.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
filters.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
important-defaults.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
infinite-queries.md feat(angular-query): injectInfiniteQuery (#6808) 2024-02-04 22:42:16 +01:00
initial-query-data.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
invalidations-from-mutations.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
migrating-to-react-query-3.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
migrating-to-react-query-4.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
migrating-to-v5.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
mutations.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
network-mode.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
optimistic-updates.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
paginated-queries.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
parallel-queries.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
placeholder-query-data.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
prefetching.md docs: modify typo (#7011) 2024-03-03 10:42:51 +01:00
queries.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
query-cancellation.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
query-functions.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
query-invalidation.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
query-keys.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
query-options.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
query-retries.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
request-waterfalls.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
scroll-restoration.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00
ssr.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
suspense.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
testing.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
updates-from-mutation-responses.md docs: Fix relative link depth (#6778) 2024-01-26 19:53:40 +11:00
window-focus-refetching.md docs: Re-organise for new docs layout (#6763) 2024-01-26 07:57:22 +11:00