Comments (4)
from query.
So instead of relying on the idempotency of the query
for the cache keying, you want to override the ID it would be given by an arbitrary string?
from query.
If that's the case, then we would need to propagate the manual key to this location here: https://github.com/tannerlinsley/react-query/blob/master/src/index.js#L524. It would need to originate in the query options and get passed through a few functions to get there.
from query.
Though not fully documented yet. You can now use a custom queryID
option to override the generated queryID normally returned from the function, eg.
// You must memoize the query function. useQuery will still detect changes to the
// `query` reference and try to refetch if it changes
const queryFn = React.useCallback(() => axios.get('/todos'), [])
// Then just pass a `queryID` string:
useQuery(queryFn, { queryID: 'fetchTodos' })
from query.
Related Issues (20)
- Getting " Cannot convert a Symbol value to a string" error in NextJs HOT 1
- Solid Query is not working correctly with ErrorBoundary HOT 1
- Query never updates when using Vitest fake timers HOT 2
- Parts of queries getting terribly mixed up in some scenarios with invalidation HOT 3
- Inconsistency between docs and code Re what params are passed to FocusManager subscribers HOT 5
- Buggy interaction between returning filtered data in the combine property for useQueries function HOT 3
- Solid Query causes unnecessary rerender on every fetch when working with objects HOT 1
- docs: solid-start example new `app.config.ts` file HOT 1
- Docs: special behaviour of `initialDataUpdatedAt=0` is not documented HOT 3
- Solid Query+Astro: JavaScript heap out of memory HOT 1
- React component "tearing"/incorrectly stuck loading with `staleTime`/`enabled`/`queryKey` changes HOT 1
- `throwOnError` does not work with Angular HOT 3
- angular-adapter: does not re-render ui on signal changes HOT 1
- React Native, pnpm: Unable to resolve module @tanstack/query-core HOT 2
- Codemod for other (non-react) supported frameworks HOT 1
- queryClient.getQueryCache is not a function at ReactQueryDevtoolsPanel2 HOT 1
- `useQueries` + `skipToken` looses `.data` type inference HOT 6
- [solid-query] Using data in a show causes double-rendering after a transition HOT 1
- refetch returning stale data HOT 3
- react query dev tools has a black text color in dark mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from query.