Fix issues with queryOptions factory method types #8394
main fromrefs/pull/8394/headmerged by TkDodo View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelspackage: react-query
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: query-core
- Resolvedby TkDodo@@ -46,7 +46,17 @@4646 export declare const dataTagErrorSymbol: unique symbol4747 export declare const unsetMarker: unique symbol4848 export type UnsetMarker = typeof unsetMarker49-export type DataTag<TType, TValue, TError = UnsetMarker> = TType & {50- [dataTagSymbol]: TValue51- [dataTagErrorSymbol]: TError49+export type AnyDataTag = {50+ [dataTagSymbol]: any51+ [dataTagErrorSymbol]: any5252 }53+export type DataTag<54+ TType,55+ TValue,56+ TError = UnsetMarker,57+> = TType extends AnyDataTag58+ ? TType59+ : TType & {60+ [dataTagSymbol]: TValue61+ [dataTagErrorSymbol]: TError62+ }
TkDodo requested changes
@@ -241,4 +243,4 @@241243 }242244243245 const options = queryOptions({244- queryKey: ['key'],246+ queryKey: ['key'] as QueryKey,- @@ -236,4 +237,5 @@236237 })237238238239 it('should be passable to UseQueryOptions', () => {239- function somethingWithQueryOptions(options: UseQueryOptions<number>) {240+ function somethingWithQueryOptions(241+ options: UseQueryOptions<number, any, any, Array<string>>,
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: vue-query
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: solid-query
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: svelte-query
github-actions[bot](GitHub profile, opens in a new tab) added labelspackage: angular-query-experimental
TkDodo reviewed
OutdatedResolvedby TkDodo@@ -13,4 +13,4 @@1313 TQueryFnData,1414 TError = DefaultError,1515 TData = InfiniteData<TQueryFnData>,16- TQueryKey extends QueryKey = QueryKey,16+ TQueryKey extends QueryKey = Array<any>,github-actions[bot](GitHub profile, opens in a new tab) removed labelspackage: vue-query
github-actions[bot](GitHub profile, opens in a new tab) removed labelspackage: solid-query
github-actions[bot](GitHub profile, opens in a new tab) removed labelspackage: svelte-query
github-actions[bot](GitHub profile, opens in a new tab) removed labelspackage: angular-query-experimental
- Resolvedby TkDodo@@ -236,4 +237,6 @@236237 })237238238239 it('should be passable to UseQueryOptions', () => {239- function somethingWithQueryOptions(options: UseQueryOptions<number>) {240+ function somethingWithQueryOptions<TQueryOpts extends AnyUseQueryOptions>(241+ options: TQueryOpts,242+ ) {
TkDodo approved these changes
TkDodo merged this4989399
TkDodo closed this
Sign in to join this conversation.
☁️ Nx Cloud Report#
CI is running/has finished running commands for commit 3b26d7512eabe56cfa3e83432b323f94446cd7c1. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 1 target
nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3Sent with 💌 from NxCloud.