Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.2k
Feature/query options#5153
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
Uh oh!
There was an error while loading. Please reload this page.
Feature/query options #5153
Changes from all commits
744ad657b250eb00b1a6895510062830d1118b36db942154fa896eeb9c7123f4276b1007d6aa9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,6 +8,28 @@ import type { | ||
| } from './types' | ||
| import { useBaseQuery } from './useBaseQuery' | ||
| export function queryOptions< | ||
| TQueryFnData = unknown, | ||
| TError = unknown, | ||
| TData = TQueryFnData, | ||
| TQueryKey extends QueryKey = QueryKey, | ||
| >( | ||
| options: UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
| ): UndefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | ||
| export function queryOptions< | ||
| TQueryFnData = unknown, | ||
| TError = unknown, | ||
| TData = TQueryFnData, | ||
| TQueryKey extends QueryKey = QueryKey, | ||
| >( | ||
| options: DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey>, | ||
| ): DefinedInitialDataOptions<TQueryFnData, TError, TData, TQueryKey> | ||
| export function queryOptions(options: unknown) { | ||
| return options | ||
| } | ||
Comment on lines
+11
to
+31
CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we move this to the core, @DamianOsipiuk ? The options are currently based on Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah this would not work as in CollaboratorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. okay then let's let every framework export their own Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, i think that would be necessary. | ||
| // HOOK | ||
| type UndefinedInitialDataOptions< | ||
| TQueryFnData = unknown, | ||
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.
Since this is
queryspecific, we would need similar helper forinfinite,mutationandqueries?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.
probably not necessary for mutations, but for infinite: yes
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.
We don't even have the initialData overload for infiniteQuery 😅
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.
I would add a separate helper in a follow-up. This is not breaking so we can add it at any time I think