-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(useQuery): add meta field #2818
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(useQuery): add meta field #2818
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tanstack/react-query/6DGpHYWBTprMYnqWwdxRd7dg7UEY |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
TkDodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please also add some tests that use
meta - we've also discussed that the
metashould be part of thequeryFnContext,e.g.:
https://github.com/tannerlinsley/react-query/blob/e6da990703482cff8ea99f5a254975cb57463ed5/src/core/query.ts#L387-L391
so that you can access it from within the queryFn, and generally everywhere where the context is available. This should also be documented then please
|
Thanks for the feedback, @TkDodo! Please take a second look. |
TkDodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, please have a look at one more finding
|
Thanks for the thorough review, @TkDodo. On to the next -- and hopefully, last -- round of feedback! |
TkDodo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks awesome 🚀
|
🎉 This PR is included in version 3.29.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
In these PR's we've introduced the persistance of react query using IndexDB. - #56828 - #68187 To avoid this persiting a query we need to add a meta property `persist: false` that was introduced on React Query by @zaguiini in TanStack/query#2818
In these PR's we've introduced the persistance of react query using IndexDB. - #56828 - #68187 To avoid this persiting a query we need to add a meta property `persist: false` that was introduced on React Query by @zaguiini in TanStack/query#2818
Closes #2772.
Usage example (parts of the code omitted for brevity):