fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: derive useQuery override type from ReturnType<typeof queryOptions>

+110 -121
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/skipToken/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, queryOptions, skipToken, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, queryOptions, skipToken, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; ··· 54 54 queryKey: serviceWithEmptyTagQueryKey(options === skipToken ? undefined : options) 55 55 }); 56 56 57 - export const useServiceWithEmptyTagQuery = (options?: Options<ServiceWithEmptyTagData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...serviceWithEmptyTagOptions(options), ...queryOptions }); 57 + export const useServiceWithEmptyTagQuery = (options?: Options<ServiceWithEmptyTagData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof serviceWithEmptyTagOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...serviceWithEmptyTagOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: getCallWithoutParametersAndResponseQueryKey(options === skipToken ? undefined : options) 114 114 }); 115 115 116 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 116 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 117 117 118 118 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 119 119 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 214 214 queryKey: callWithDefaultParametersQueryKey(options === skipToken ? undefined : options) 215 215 }); 216 216 217 - export const useCallWithDefaultParametersQuery = (options: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 217 + export const useCallWithDefaultParametersQuery = (options: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 218 218 219 219 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 220 220 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 273 273 queryKey: duplicateName2QueryKey(options === skipToken ? undefined : options) 274 274 }); 275 275 276 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 276 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 277 277 278 278 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 279 279 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 318 318 queryKey: callWithNoContentResponseQueryKey(options === skipToken ? undefined : options) 319 319 }); 320 320 321 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 321 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 322 322 323 323 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 324 324 ··· 335 335 queryKey: callWithResponseAndNoContentResponseQueryKey(options === skipToken ? undefined : options) 336 336 }); 337 337 338 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 338 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 339 339 340 340 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 341 341 ··· 352 352 queryKey: dummyAQueryKey(options === skipToken ? undefined : options) 353 353 }); 354 354 355 - export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 355 + export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 356 356 357 357 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 358 358 ··· 369 369 queryKey: dummyBQueryKey(options === skipToken ? undefined : options) 370 370 }); 371 371 372 - export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 372 + export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 373 373 374 374 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 375 375 ··· 386 386 queryKey: callWithResponseQueryKey(options === skipToken ? undefined : options) 387 387 }); 388 388 389 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 389 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 390 390 391 391 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 392 392 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 431 431 queryKey: collectionFormatQueryKey(options === skipToken ? undefined : options) 432 432 }); 433 433 434 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 434 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 435 435 436 436 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 437 437 ··· 448 448 queryKey: typesQueryKey(options === skipToken ? undefined : options) 449 449 }); 450 450 451 - export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 451 + export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 452 452 453 453 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 454 454 ··· 465 465 queryKey: complexTypesQueryKey(options === skipToken ? undefined : options) 466 466 }); 467 467 468 - export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 468 + export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 469 469 470 470 export const callWithResultFromHeaderMutation = (options?: Partial<Options<CallWithResultFromHeaderData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> => { 471 471 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> = {
+13 -13
packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/useQuery/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, queryOptions, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, queryOptions, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexTypes, deleteCallWithoutParametersAndResponse, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, fooWow, getCallWithoutParametersAndResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionBody, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, serviceWithEmptyTag, testErrorCode, types } from '../sdk.gen'; ··· 54 54 queryKey: serviceWithEmptyTagQueryKey(options) 55 55 }); 56 56 57 - export const useServiceWithEmptyTagQuery = (options?: Options<ServiceWithEmptyTagData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...serviceWithEmptyTagOptions(options), ...queryOptions }); 57 + export const useServiceWithEmptyTagQuery = (options?: Options<ServiceWithEmptyTagData>, queryOptions?: Partial<Omit<ReturnType<typeof serviceWithEmptyTagOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...serviceWithEmptyTagOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: getCallWithoutParametersAndResponseQueryKey(options) 114 114 }); 115 115 116 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 116 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 117 117 118 118 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 119 119 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 214 214 queryKey: callWithDefaultParametersQueryKey(options) 215 215 }); 216 216 217 - export const useCallWithDefaultParametersQuery = (options: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 217 + export const useCallWithDefaultParametersQuery = (options: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 218 218 219 219 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 220 220 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 273 273 queryKey: duplicateName2QueryKey(options) 274 274 }); 275 275 276 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 276 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 277 277 278 278 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 279 279 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 318 318 queryKey: callWithNoContentResponseQueryKey(options) 319 319 }); 320 320 321 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 321 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 322 322 323 323 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 324 324 ··· 335 335 queryKey: callWithResponseAndNoContentResponseQueryKey(options) 336 336 }); 337 337 338 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 338 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 339 339 340 340 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 341 341 ··· 352 352 queryKey: dummyAQueryKey(options) 353 353 }); 354 354 355 - export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 355 + export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 356 356 357 357 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 358 358 ··· 369 369 queryKey: dummyBQueryKey(options) 370 370 }); 371 371 372 - export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 372 + export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 373 373 374 374 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 375 375 ··· 386 386 queryKey: callWithResponseQueryKey(options) 387 387 }); 388 388 389 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 389 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 390 390 391 391 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 392 392 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 431 431 queryKey: collectionFormatQueryKey(options) 432 432 }); 433 433 434 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 434 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 435 435 436 436 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 437 437 ··· 448 448 queryKey: typesQueryKey(options) 449 449 }); 450 450 451 - export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 451 + export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 452 452 453 453 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 454 454 ··· 465 465 queryKey: complexTypesQueryKey(options) 466 466 }); 467 467 468 - export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 468 + export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 469 469 470 470 export const callWithResultFromHeaderMutation = (options?: Partial<Options<CallWithResultFromHeaderData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> => { 471 471 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> = {
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/skipToken/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, skipToken, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, skipToken, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; ··· 54 54 queryKey: exportQueryKey(options === skipToken ? undefined : options) 55 55 }); 56 56 57 - export const useExportQuery = (options?: Options<ExportData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 57 + export const useExportQuery = (options?: Options<ExportData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof exportOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: apiVVersionODataControllerCountQueryKey(options === skipToken ? undefined : options) 114 114 }); 115 115 116 - export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 116 + export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof apiVVersionODataControllerCountOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 117 117 118 118 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 119 119 ··· 130 130 queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options === skipToken ? undefined : options) 131 131 }); 132 132 133 - export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 133 + export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getApiVbyApiVersionSimpleOperationOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 134 134 135 135 export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial<Options<DeleteCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> => { 136 136 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> = { ··· 161 161 queryKey: getCallWithoutParametersAndResponseQueryKey(options === skipToken ? undefined : options) 162 162 }); 163 163 164 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 164 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 165 165 166 166 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 167 167 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 346 346 queryKey: getCallWithOptionalParamInfiniteQueryKey(options === skipToken ? undefined : options) 347 347 }); 348 348 349 - export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 349 + export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithOptionalParamOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 350 350 351 351 export const postCallWithOptionalParamMutation = (options?: Partial<Options<PostCallWithOptionalParamData>>): UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> => { 352 352 const mutationOptions: UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> = { ··· 405 405 queryKey: callWithDefaultParametersQueryKey(options === skipToken ? undefined : options) 406 406 }); 407 407 408 - export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 408 + export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 409 409 410 410 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 411 411 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 464 464 queryKey: duplicateName2QueryKey(options === skipToken ? undefined : options) 465 465 }); 466 466 467 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 467 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 468 468 469 469 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 470 470 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 509 509 queryKey: callWithNoContentResponseQueryKey(options === skipToken ? undefined : options) 510 510 }); 511 511 512 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 512 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 513 513 514 514 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 515 515 ··· 526 526 queryKey: callWithResponseAndNoContentResponseQueryKey(options === skipToken ? undefined : options) 527 527 }); 528 528 529 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 529 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 530 530 531 531 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 532 532 ··· 543 543 queryKey: dummyAQueryKey(options === skipToken ? undefined : options) 544 544 }); 545 545 546 - export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<DummyAResponse, DefaultError, DummyAResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 546 + export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 547 547 548 548 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 549 549 ··· 560 560 queryKey: dummyBQueryKey(options === skipToken ? undefined : options) 561 561 }); 562 562 563 - export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<DummyBResponse, DefaultError, DummyBResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 563 + export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 564 564 565 565 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 566 566 ··· 577 577 queryKey: callWithResponseQueryKey(options === skipToken ? undefined : options) 578 578 }); 579 579 580 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 580 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 581 581 582 582 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 583 583 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 622 622 queryKey: collectionFormatQueryKey(options === skipToken ? undefined : options) 623 623 }); 624 624 625 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 625 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 626 626 627 627 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 628 628 ··· 639 639 queryKey: typesQueryKey(options === skipToken ? undefined : options) 640 640 }); 641 641 642 - export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 642 + export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 643 643 644 644 export const uploadFileMutation = (options?: Partial<Options<UploadFileData>>): UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> => { 645 645 const mutationOptions: UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> = { ··· 670 670 queryKey: fileResponseQueryKey(options === skipToken ? undefined : options) 671 671 }); 672 672 673 - export const useFileResponseQuery = (options: Options<FileResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<FileResponseResponse, DefaultError, FileResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 673 + export const useFileResponseQuery = (options: Options<FileResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof fileResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 674 674 675 675 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 676 676 ··· 687 687 queryKey: complexTypesQueryKey(options === skipToken ? undefined : options) 688 688 }); 689 689 690 - export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 690 + export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 691 691 692 692 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 693 693 ··· 704 704 queryKey: multipartResponseQueryKey(options === skipToken ? undefined : options) 705 705 }); 706 706 707 - export const useMultipartResponseQuery = (options?: Options<MultipartResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 707 + export const useMultipartResponseQuery = (options?: Options<MultipartResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof multipartResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 708 708 709 709 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> => { 710 710 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> = {
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/react-query/useQuery/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; ··· 54 54 queryKey: exportQueryKey(options) 55 55 }); 56 56 57 - export const useExportQuery = (options?: Options<ExportData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 57 + export const useExportQuery = (options?: Options<ExportData>, queryOptions?: Partial<Omit<ReturnType<typeof exportOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: apiVVersionODataControllerCountQueryKey(options) 114 114 }); 115 115 116 - export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData>, queryOptions?: Partial<Omit<UseQueryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 116 + export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData>, queryOptions?: Partial<Omit<ReturnType<typeof apiVVersionODataControllerCountOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 117 117 118 118 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 119 119 ··· 130 130 queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) 131 131 }); 132 132 133 - export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData>, queryOptions?: Partial<Omit<UseQueryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 133 + export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData>, queryOptions?: Partial<Omit<ReturnType<typeof getApiVbyApiVersionSimpleOperationOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 134 134 135 135 export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial<Options<DeleteCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> => { 136 136 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> = { ··· 161 161 queryKey: getCallWithoutParametersAndResponseQueryKey(options) 162 162 }); 163 163 164 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 164 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 165 165 166 166 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 167 167 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 346 346 queryKey: getCallWithOptionalParamInfiniteQueryKey(options) 347 347 }); 348 348 349 - export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 349 + export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData>, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithOptionalParamOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 350 350 351 351 export const postCallWithOptionalParamMutation = (options?: Partial<Options<PostCallWithOptionalParamData>>): UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> => { 352 352 const mutationOptions: UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> = { ··· 405 405 queryKey: callWithDefaultParametersQueryKey(options) 406 406 }); 407 407 408 - export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 408 + export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 409 409 410 410 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 411 411 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 464 464 queryKey: duplicateName2QueryKey(options) 465 465 }); 466 466 467 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 467 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 468 468 469 469 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 470 470 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 509 509 queryKey: callWithNoContentResponseQueryKey(options) 510 510 }); 511 511 512 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 512 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 513 513 514 514 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 515 515 ··· 526 526 queryKey: callWithResponseAndNoContentResponseQueryKey(options) 527 527 }); 528 528 529 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 529 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 530 530 531 531 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 532 532 ··· 543 543 queryKey: dummyAQueryKey(options) 544 544 }); 545 545 546 - export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<UseQueryOptions<DummyAResponse, DefaultError, DummyAResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 546 + export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 547 547 548 548 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 549 549 ··· 560 560 queryKey: dummyBQueryKey(options) 561 561 }); 562 562 563 - export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<UseQueryOptions<DummyBResponse, DefaultError, DummyBResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 563 + export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 564 564 565 565 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 566 566 ··· 577 577 queryKey: callWithResponseQueryKey(options) 578 578 }); 579 579 580 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 580 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 581 581 582 582 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 583 583 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 622 622 queryKey: collectionFormatQueryKey(options) 623 623 }); 624 624 625 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 625 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 626 626 627 627 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 628 628 ··· 639 639 queryKey: typesQueryKey(options) 640 640 }); 641 641 642 - export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 642 + export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 643 643 644 644 export const uploadFileMutation = (options?: Partial<Options<UploadFileData>>): UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> => { 645 645 const mutationOptions: UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> = { ··· 670 670 queryKey: fileResponseQueryKey(options) 671 671 }); 672 672 673 - export const useFileResponseQuery = (options: Options<FileResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<FileResponseResponse, DefaultError, FileResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 673 + export const useFileResponseQuery = (options: Options<FileResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof fileResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 674 674 675 675 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 676 676 ··· 687 687 queryKey: complexTypesQueryKey(options) 688 688 }); 689 689 690 - export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 690 + export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 691 691 692 692 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 693 693 ··· 704 704 queryKey: multipartResponseQueryKey(options) 705 705 }); 706 706 707 - export const useMultipartResponseQuery = (options?: Options<MultipartResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 707 + export const useMultipartResponseQuery = (options?: Options<MultipartResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof multipartResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 708 708 709 709 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> => { 710 710 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> = {
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/skipToken/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, skipToken, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, skipToken, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; ··· 54 54 queryKey: exportQueryKey(options === skipToken ? undefined : options) 55 55 }); 56 56 57 - export const useExportQuery = (options?: Options<ExportData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 57 + export const useExportQuery = (options?: Options<ExportData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof exportOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: apiVVersionODataControllerCountQueryKey(options === skipToken ? undefined : options) 114 114 }); 115 115 116 - export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 116 + export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof apiVVersionODataControllerCountOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 117 117 118 118 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 119 119 ··· 130 130 queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options === skipToken ? undefined : options) 131 131 }); 132 132 133 - export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 133 + export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getApiVbyApiVersionSimpleOperationOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 134 134 135 135 export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial<Options<DeleteCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> => { 136 136 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> = { ··· 161 161 queryKey: getCallWithoutParametersAndResponseQueryKey(options === skipToken ? undefined : options) 162 162 }); 163 163 164 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 164 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 165 165 166 166 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 167 167 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 346 346 queryKey: getCallWithOptionalParamInfiniteQueryKey(options === skipToken ? undefined : options) 347 347 }); 348 348 349 - export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 349 + export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithOptionalParamOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 350 350 351 351 export const postCallWithOptionalParamMutation = (options?: Partial<Options<PostCallWithOptionalParamData>>): UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> => { 352 352 const mutationOptions: UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> = { ··· 405 405 queryKey: callWithDefaultParametersQueryKey(options === skipToken ? undefined : options) 406 406 }); 407 407 408 - export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 408 + export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 409 409 410 410 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 411 411 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 464 464 queryKey: duplicateName2QueryKey(options === skipToken ? undefined : options) 465 465 }); 466 466 467 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 467 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 468 468 469 469 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 470 470 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 509 509 queryKey: callWithNoContentResponseQueryKey(options === skipToken ? undefined : options) 510 510 }); 511 511 512 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 512 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 513 513 514 514 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 515 515 ··· 526 526 queryKey: callWithResponseAndNoContentResponseQueryKey(options === skipToken ? undefined : options) 527 527 }); 528 528 529 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 529 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 530 530 531 531 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 532 532 ··· 543 543 queryKey: dummyAQueryKey(options === skipToken ? undefined : options) 544 544 }); 545 545 546 - export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<DummyAResponse, DefaultError, DummyAResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 546 + export const useDummyAQuery = (options?: Options<DummyAData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 547 547 548 548 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 549 549 ··· 560 560 queryKey: dummyBQueryKey(options === skipToken ? undefined : options) 561 561 }); 562 562 563 - export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<DummyBResponse, DefaultError, DummyBResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 563 + export const useDummyBQuery = (options?: Options<DummyBData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 564 564 565 565 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 566 566 ··· 577 577 queryKey: callWithResponseQueryKey(options === skipToken ? undefined : options) 578 578 }); 579 579 580 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 580 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 581 581 582 582 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 583 583 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 622 622 queryKey: collectionFormatQueryKey(options === skipToken ? undefined : options) 623 623 }); 624 624 625 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 625 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 626 626 627 627 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 628 628 ··· 639 639 queryKey: typesQueryKey(options === skipToken ? undefined : options) 640 640 }); 641 641 642 - export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 642 + export const useTypesQuery = (options: Options<TypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 643 643 644 644 export const uploadFileMutation = (options?: Partial<Options<UploadFileData>>): UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> => { 645 645 const mutationOptions: UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> = { ··· 670 670 queryKey: fileResponseQueryKey(options === skipToken ? undefined : options) 671 671 }); 672 672 673 - export const useFileResponseQuery = (options: Options<FileResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<FileResponseResponse, DefaultError, FileResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 673 + export const useFileResponseQuery = (options: Options<FileResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof fileResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 674 674 675 675 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 676 676 ··· 687 687 queryKey: complexTypesQueryKey(options === skipToken ? undefined : options) 688 688 }); 689 689 690 - export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 690 + export const useComplexTypesQuery = (options: Options<ComplexTypesData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 691 691 692 692 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 693 693 ··· 704 704 queryKey: multipartResponseQueryKey(options === skipToken ? undefined : options) 705 705 }); 706 706 707 - export const useMultipartResponseQuery = (options?: Options<MultipartResponseData> | typeof skipToken, queryOptions?: Partial<Omit<UseQueryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 707 + export const useMultipartResponseQuery = (options?: Options<MultipartResponseData> | typeof skipToken, queryOptions?: Partial<Omit<ReturnType<typeof multipartResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 708 708 709 709 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> => { 710 710 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> = {
+18 -18
packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/plugins/@tanstack/react-query/useQuery/@tanstack/react-query.gen.ts
··· 1 1 // This file is auto-generated by @hey-api/openapi-ts 2 2 3 - import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions, useQuery, type UseQueryOptions } from '@tanstack/react-query'; 3 + import { type DefaultError, type InfiniteData, infiniteQueryOptions, queryOptions, type UseMutationOptions, useQuery } from '@tanstack/react-query'; 4 4 5 5 import { client } from '../client.gen'; 6 6 import { apiVVersionODataControllerCount, callToTestOrderOfParams, callWithDefaultOptionalParameters, callWithDefaultParameters, callWithDescriptions, callWithDuplicateResponses, callWithNoContentResponse, callWithParameters, callWithResponse, callWithResponseAndNoContentResponse, callWithResponses, callWithResultFromHeader, callWithWeirdParameterNames, collectionFormat, complexParams, complexTypes, deleteCallWithoutParametersAndResponse, deleteFoo, deprecatedCall, dummyA, dummyB, duplicateName, duplicateName2, duplicateName3, duplicateName4, export_, fileResponse, fooWow, getApiVbyApiVersionSimpleOperation, getCallWithOptionalParam, getCallWithoutParametersAndResponse, import_, multipartRequest, multipartResponse, nonAsciiæøåÆøÅöôêÊ字符串, type Options, patchApiVbyApiVersionNoTag, patchCallWithoutParametersAndResponse, postApiVbyApiVersionFormData, postApiVbyApiVersionRequestBody, postCallWithOptionalParam, postCallWithoutParametersAndResponse, putCallWithoutParametersAndResponse, putWithFormUrlEncoded, testErrorCode, types, uploadFile } from '../sdk.gen'; ··· 54 54 queryKey: exportQueryKey(options) 55 55 }); 56 56 57 - export const useExportQuery = (options?: Options<ExportData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 57 + export const useExportQuery = (options?: Options<ExportData>, queryOptions?: Partial<Omit<ReturnType<typeof exportOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...exportOptions(options), ...queryOptions }); 58 58 59 59 export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => { 60 60 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = { ··· 113 113 queryKey: apiVVersionODataControllerCountQueryKey(options) 114 114 }); 115 115 116 - export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData>, queryOptions?: Partial<Omit<UseQueryOptions<ApiVVersionODataControllerCountResponse, DefaultError, ApiVVersionODataControllerCountResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 116 + export const useApiVVersionODataControllerCountQuery = (options?: Options<ApiVVersionODataControllerCountData>, queryOptions?: Partial<Omit<ReturnType<typeof apiVVersionODataControllerCountOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...apiVVersionODataControllerCountOptions(options), ...queryOptions }); 117 117 118 118 export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options<GetApiVbyApiVersionSimpleOperationData>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); 119 119 ··· 130 130 queryKey: getApiVbyApiVersionSimpleOperationQueryKey(options) 131 131 }); 132 132 133 - export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData>, queryOptions?: Partial<Omit<UseQueryOptions<GetApiVbyApiVersionSimpleOperationResponse, GetApiVbyApiVersionSimpleOperationError, GetApiVbyApiVersionSimpleOperationResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 133 + export const useGetApiVbyApiVersionSimpleOperationQuery = (options: Options<GetApiVbyApiVersionSimpleOperationData>, queryOptions?: Partial<Omit<ReturnType<typeof getApiVbyApiVersionSimpleOperationOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getApiVbyApiVersionSimpleOperationOptions(options), ...queryOptions }); 134 134 135 135 export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial<Options<DeleteCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> => { 136 136 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DeleteCallWithoutParametersAndResponseData>> = { ··· 161 161 queryKey: getCallWithoutParametersAndResponseQueryKey(options) 162 162 }); 163 163 164 - export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 164 + export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithoutParametersAndResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithoutParametersAndResponseOptions(options), ...queryOptions }); 165 165 166 166 export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => { 167 167 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = { ··· 346 346 queryKey: getCallWithOptionalParamInfiniteQueryKey(options) 347 347 }); 348 348 349 - export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 349 + export const useGetCallWithOptionalParamQuery = (options: Options<GetCallWithOptionalParamData>, queryOptions?: Partial<Omit<ReturnType<typeof getCallWithOptionalParamOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...getCallWithOptionalParamOptions(options), ...queryOptions }); 350 350 351 351 export const postCallWithOptionalParamMutation = (options?: Partial<Options<PostCallWithOptionalParamData>>): UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> => { 352 352 const mutationOptions: UseMutationOptions<PostCallWithOptionalParamResponse, DefaultError, Options<PostCallWithOptionalParamData>> = { ··· 405 405 queryKey: callWithDefaultParametersQueryKey(options) 406 406 }); 407 407 408 - export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 408 + export const useCallWithDefaultParametersQuery = (options?: Options<CallWithDefaultParametersData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithDefaultParametersOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithDefaultParametersOptions(options), ...queryOptions }); 409 409 410 410 export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => { 411 411 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = { ··· 464 464 queryKey: duplicateName2QueryKey(options) 465 465 }); 466 466 467 - export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 467 + export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>, queryOptions?: Partial<Omit<ReturnType<typeof duplicateName2Options>, 'queryKey' | 'queryFn'>>) => useQuery({ ...duplicateName2Options(options), ...queryOptions }); 468 468 469 469 export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => { 470 470 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = { ··· 509 509 queryKey: callWithNoContentResponseQueryKey(options) 510 510 }); 511 511 512 - export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithNoContentResponseResponse, DefaultError, CallWithNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 512 + export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithNoContentResponseOptions(options), ...queryOptions }); 513 513 514 514 export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options); 515 515 ··· 526 526 queryKey: callWithResponseAndNoContentResponseQueryKey(options) 527 527 }); 528 528 529 - export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 529 + export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseAndNoContentResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseAndNoContentResponseOptions(options), ...queryOptions }); 530 530 531 531 export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options); 532 532 ··· 543 543 queryKey: dummyAQueryKey(options) 544 544 }); 545 545 546 - export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<UseQueryOptions<DummyAResponse, DefaultError, DummyAResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 546 + export const useDummyAQuery = (options?: Options<DummyAData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyAOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyAOptions(options), ...queryOptions }); 547 547 548 548 export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options); 549 549 ··· 560 560 queryKey: dummyBQueryKey(options) 561 561 }); 562 562 563 - export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<UseQueryOptions<DummyBResponse, DefaultError, DummyBResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 563 + export const useDummyBQuery = (options?: Options<DummyBData>, queryOptions?: Partial<Omit<ReturnType<typeof dummyBOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...dummyBOptions(options), ...queryOptions }); 564 564 565 565 export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options); 566 566 ··· 577 577 queryKey: callWithResponseQueryKey(options) 578 578 }); 579 579 580 - export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 580 + export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof callWithResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...callWithResponseOptions(options), ...queryOptions }); 581 581 582 582 export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => { 583 583 const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = { ··· 622 622 queryKey: collectionFormatQueryKey(options) 623 623 }); 624 624 625 - export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<UseQueryOptions<unknown, DefaultError, unknown>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 625 + export const useCollectionFormatQuery = (options: Options<CollectionFormatData>, queryOptions?: Partial<Omit<ReturnType<typeof collectionFormatOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...collectionFormatOptions(options), ...queryOptions }); 626 626 627 627 export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options); 628 628 ··· 639 639 queryKey: typesQueryKey(options) 640 640 }); 641 641 642 - export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<UseQueryOptions<TypesResponse, DefaultError, TypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 642 + export const useTypesQuery = (options: Options<TypesData>, queryOptions?: Partial<Omit<ReturnType<typeof typesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...typesOptions(options), ...queryOptions }); 643 643 644 644 export const uploadFileMutation = (options?: Partial<Options<UploadFileData>>): UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> => { 645 645 const mutationOptions: UseMutationOptions<UploadFileResponse, DefaultError, Options<UploadFileData>> = { ··· 670 670 queryKey: fileResponseQueryKey(options) 671 671 }); 672 672 673 - export const useFileResponseQuery = (options: Options<FileResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<FileResponseResponse, DefaultError, FileResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 673 + export const useFileResponseQuery = (options: Options<FileResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof fileResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...fileResponseOptions(options), ...queryOptions }); 674 674 675 675 export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options); 676 676 ··· 687 687 queryKey: complexTypesQueryKey(options) 688 688 }); 689 689 690 - export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<UseQueryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 690 + export const useComplexTypesQuery = (options: Options<ComplexTypesData>, queryOptions?: Partial<Omit<ReturnType<typeof complexTypesOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...complexTypesOptions(options), ...queryOptions }); 691 691 692 692 export const multipartResponseQueryKey = (options?: Options<MultipartResponseData>) => createQueryKey('multipartResponse', options); 693 693 ··· 704 704 queryKey: multipartResponseQueryKey(options) 705 705 }); 706 706 707 - export const useMultipartResponseQuery = (options?: Options<MultipartResponseData>, queryOptions?: Partial<Omit<UseQueryOptions<MultipartResponseResponse, DefaultError, MultipartResponseResponse>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 707 + export const useMultipartResponseQuery = (options?: Options<MultipartResponseData>, queryOptions?: Partial<Omit<ReturnType<typeof multipartResponseOptions>, 'queryKey' | 'queryFn'>>) => useQuery({ ...multipartResponseOptions(options), ...queryOptions }); 708 708 709 709 export const multipartRequestMutation = (options?: Partial<Options<MultipartRequestData>>): UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> => { 710 710 const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<MultipartRequestData>> = {
+12 -23
packages/openapi-ts/src/plugins/@tanstack/query-core/v5/useQuery.ts
··· 7 7 isOperationOptionsRequired, 8 8 } from '../../../../plugins/shared/utils/operation'; 9 9 import { $ } from '../../../../ts-dsl'; 10 - import { useTypeData, useTypeError, useTypeResponse } from '../shared/useType'; 10 + import { useTypeData } from '../shared/useType'; 11 11 import type { PluginInstance } from '../types'; 12 12 13 13 const optionsParamName = 'options'; ··· 42 42 const symbolSkipToken = hasSkipToken ? plugin.external(`${plugin.name}.skipToken`) : undefined; 43 43 const paramType = symbolSkipToken ? $.type.or(typeData, $.type.query(symbolSkipToken)) : typeData; 44 44 45 - const typeResponse = useTypeResponse({ operation, plugin }); 46 - 47 - const symbolQueryOptionsType = plugin.external(`${plugin.name}.QueryObserverOptions`); 48 - const queryType = $.type(symbolQueryOptionsType) 49 - .generic(typeResponse) 50 - .generic(useTypeError({ operation, plugin })) 51 - .generic(typeResponse); 52 - 53 45 const symbolQueryOptionsFn = plugin.referenceSymbol({ 54 46 category: 'hook', 55 47 resource: 'operation', ··· 57 49 role: 'queryOptions', 58 50 tool: plugin.name, 59 51 }); 52 + 53 + const queryOptionsReturnType = $.type('Partial').generic( 54 + $.type('Omit', (t) => 55 + t.generics( 56 + $(symbolQueryOptionsFn).returnType(), 57 + $.type.or($.type.literal('queryKey'), $.type.literal('queryFn')), 58 + ), 59 + ), 60 + ); 61 + 60 62 const statement = $.const(symbolUseQueryFn) 61 63 .export() 62 64 .$if(plugin.config.comments && createOperationComment(operation), (c, v) => c.doc(v)) 63 65 .assign( 64 66 $.func() 65 67 .param(optionsParamName, (p) => p.required(isRequiredOptions).type(paramType)) 66 - .param(queryOptionsParamName, (p) => 67 - p 68 - .optional() 69 - .type( 70 - $.type('Partial').generic( 71 - $.type('Omit', (t) => 72 - t.generics( 73 - queryType, 74 - $.type.or($.type.literal('queryKey'), $.type.literal('queryFn')), 75 - ), 76 - ), 77 - ), 78 - ), 79 - ) 68 + .param(queryOptionsParamName, (p) => p.optional().type(queryOptionsReturnType)) 80 69 .do( 81 70 $(symbolUseQuery) 82 71 .call(