Skip to content

Commit 07988db

Browse files
committed
test: update snapshots
1 parent b0602a5 commit 07988db

55 files changed

Lines changed: 328 additions & 14004 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/useMutation/@tanstack/react-query.gen.ts

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// This file is auto-generated by @hey-api/openapi-ts
22

3-
import { type DefaultError, queryOptions, useMutation, type UseMutationOptions } from '@tanstack/react-query';
3+
import { type DefaultError, queryOptions, useMutation, type UseMutationOptions, useQuery, useQueryClient } from '@tanstack/react-query';
44

55
import { client } from '../client.gen';
66
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,6 +54,13 @@ export const serviceWithEmptyTagOptions = (options?: Options<ServiceWithEmptyTag
5454
queryKey: serviceWithEmptyTagQueryKey(options)
5555
});
5656

57+
export const useServiceWithEmptyTagQuery = (options?: Options<ServiceWithEmptyTagData>) => useQuery(serviceWithEmptyTagOptions(options));
58+
59+
export const useServiceWithEmptyTagSetQueryData = () => {
60+
const queryClient = useQueryClient();
61+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<ServiceWithEmptyTagData>) => queryClient.setQueryData(serviceWithEmptyTagOptions(options).queryKey, updater);
62+
};
63+
5764
export const patchApiVbyApiVersionNoTagMutation = (options?: Partial<Options<PatchApiVbyApiVersionNoTagData>>): UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> => {
5865
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchApiVbyApiVersionNoTagData>> = {
5966
mutationFn: async (fnOptions) => {
@@ -117,6 +124,13 @@ export const getCallWithoutParametersAndResponseOptions = (options?: Options<Get
117124
queryKey: getCallWithoutParametersAndResponseQueryKey(options)
118125
});
119126

127+
export const useGetCallWithoutParametersAndResponseQuery = (options?: Options<GetCallWithoutParametersAndResponseData>) => useQuery(getCallWithoutParametersAndResponseOptions(options));
128+
129+
export const useGetCallWithoutParametersAndResponseSetQueryData = () => {
130+
const queryClient = useQueryClient();
131+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<GetCallWithoutParametersAndResponseData>) => queryClient.setQueryData(getCallWithoutParametersAndResponseOptions(options).queryKey, updater);
132+
};
133+
120134
export const patchCallWithoutParametersAndResponseMutation = (options?: Partial<Options<PatchCallWithoutParametersAndResponseData>>): UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> => {
121135
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<PatchCallWithoutParametersAndResponseData>> = {
122136
mutationFn: async (fnOptions) => {
@@ -228,6 +242,13 @@ export const callWithDefaultParametersOptions = (options: Options<CallWithDefaul
228242
queryKey: callWithDefaultParametersQueryKey(options)
229243
});
230244

245+
export const useCallWithDefaultParametersQuery = (options: Options<CallWithDefaultParametersData>) => useQuery(callWithDefaultParametersOptions(options));
246+
247+
export const useCallWithDefaultParametersSetQueryData = () => {
248+
const queryClient = useQueryClient();
249+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options: Options<CallWithDefaultParametersData>) => queryClient.setQueryData(callWithDefaultParametersOptions(options).queryKey, updater);
250+
};
251+
231252
export const callWithDefaultOptionalParametersMutation = (options?: Partial<Options<CallWithDefaultOptionalParametersData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> => {
232253
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithDefaultOptionalParametersData>> = {
233254
mutationFn: async (fnOptions) => {
@@ -291,6 +312,13 @@ export const duplicateName2Options = (options?: Options<DuplicateName2Data>) =>
291312
queryKey: duplicateName2QueryKey(options)
292313
});
293314

315+
export const useDuplicateName2Query = (options?: Options<DuplicateName2Data>) => useQuery(duplicateName2Options(options));
316+
317+
export const useDuplicateName2SetQueryData = () => {
318+
const queryClient = useQueryClient();
319+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<DuplicateName2Data>) => queryClient.setQueryData(duplicateName2Options(options).queryKey, updater);
320+
};
321+
294322
export const duplicateName3Mutation = (options?: Partial<Options<DuplicateName3Data>>): UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> => {
295323
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<DuplicateName3Data>> = {
296324
mutationFn: async (fnOptions) => {
@@ -338,6 +366,13 @@ export const callWithNoContentResponseOptions = (options?: Options<CallWithNoCon
338366
queryKey: callWithNoContentResponseQueryKey(options)
339367
});
340368

369+
export const useCallWithNoContentResponseQuery = (options?: Options<CallWithNoContentResponseData>) => useQuery(callWithNoContentResponseOptions(options));
370+
371+
export const useCallWithNoContentResponseSetQueryData = () => {
372+
const queryClient = useQueryClient();
373+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<CallWithNoContentResponseData>) => queryClient.setQueryData(callWithNoContentResponseOptions(options).queryKey, updater);
374+
};
375+
341376
export const callWithResponseAndNoContentResponseQueryKey = (options?: Options<CallWithResponseAndNoContentResponseData>) => createQueryKey('callWithResponseAndNoContentResponse', options);
342377

343378
export const callWithResponseAndNoContentResponseOptions = (options?: Options<CallWithResponseAndNoContentResponseData>) => queryOptions<CallWithResponseAndNoContentResponseResponse, DefaultError, CallWithResponseAndNoContentResponseResponse, ReturnType<typeof callWithResponseAndNoContentResponseQueryKey>>({
@@ -353,6 +388,13 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options<Ca
353388
queryKey: callWithResponseAndNoContentResponseQueryKey(options)
354389
});
355390

391+
export const useCallWithResponseAndNoContentResponseQuery = (options?: Options<CallWithResponseAndNoContentResponseData>) => useQuery(callWithResponseAndNoContentResponseOptions(options));
392+
393+
export const useCallWithResponseAndNoContentResponseSetQueryData = () => {
394+
const queryClient = useQueryClient();
395+
return (updater: CallWithResponseAndNoContentResponseResponse | undefined | ((old: CallWithResponseAndNoContentResponseResponse | undefined) => CallWithResponseAndNoContentResponseResponse | undefined), options?: Options<CallWithResponseAndNoContentResponseData>) => queryClient.setQueryData(callWithResponseAndNoContentResponseOptions(options).queryKey, updater);
396+
};
397+
356398
export const dummyAQueryKey = (options?: Options<DummyAData>) => createQueryKey('dummyA', options);
357399

358400
export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyAQueryKey>>({
@@ -368,6 +410,13 @@ export const dummyAOptions = (options?: Options<DummyAData>) => queryOptions<unk
368410
queryKey: dummyAQueryKey(options)
369411
});
370412

413+
export const useDummyAQuery = (options?: Options<DummyAData>) => useQuery(dummyAOptions(options));
414+
415+
export const useDummyASetQueryData = () => {
416+
const queryClient = useQueryClient();
417+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<DummyAData>) => queryClient.setQueryData(dummyAOptions(options).queryKey, updater);
418+
};
419+
371420
export const dummyBQueryKey = (options?: Options<DummyBData>) => createQueryKey('dummyB', options);
372421

373422
export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unknown, DefaultError, unknown, ReturnType<typeof dummyBQueryKey>>({
@@ -383,6 +432,13 @@ export const dummyBOptions = (options?: Options<DummyBData>) => queryOptions<unk
383432
queryKey: dummyBQueryKey(options)
384433
});
385434

435+
export const useDummyBQuery = (options?: Options<DummyBData>) => useQuery(dummyBOptions(options));
436+
437+
export const useDummyBSetQueryData = () => {
438+
const queryClient = useQueryClient();
439+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options?: Options<DummyBData>) => queryClient.setQueryData(dummyBOptions(options).queryKey, updater);
440+
};
441+
386442
export const callWithResponseQueryKey = (options?: Options<CallWithResponseData>) => createQueryKey('callWithResponse', options);
387443

388444
export const callWithResponseOptions = (options?: Options<CallWithResponseData>) => queryOptions<CallWithResponseResponse, DefaultError, CallWithResponseResponse, ReturnType<typeof callWithResponseQueryKey>>({
@@ -398,6 +454,13 @@ export const callWithResponseOptions = (options?: Options<CallWithResponseData>)
398454
queryKey: callWithResponseQueryKey(options)
399455
});
400456

457+
export const useCallWithResponseQuery = (options?: Options<CallWithResponseData>) => useQuery(callWithResponseOptions(options));
458+
459+
export const useCallWithResponseSetQueryData = () => {
460+
const queryClient = useQueryClient();
461+
return (updater: CallWithResponseResponse | undefined | ((old: CallWithResponseResponse | undefined) => CallWithResponseResponse | undefined), options?: Options<CallWithResponseData>) => queryClient.setQueryData(callWithResponseOptions(options).queryKey, updater);
462+
};
463+
401464
export const callWithDuplicateResponsesMutation = (options?: Partial<Options<CallWithDuplicateResponsesData>>): UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> => {
402465
const mutationOptions: UseMutationOptions<CallWithDuplicateResponsesResponse, CallWithDuplicateResponsesError, Options<CallWithDuplicateResponsesData>> = {
403466
mutationFn: async (fnOptions) => {
@@ -445,6 +508,13 @@ export const collectionFormatOptions = (options: Options<CollectionFormatData>)
445508
queryKey: collectionFormatQueryKey(options)
446509
});
447510

511+
export const useCollectionFormatQuery = (options: Options<CollectionFormatData>) => useQuery(collectionFormatOptions(options));
512+
513+
export const useCollectionFormatSetQueryData = () => {
514+
const queryClient = useQueryClient();
515+
return (updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined), options: Options<CollectionFormatData>) => queryClient.setQueryData(collectionFormatOptions(options).queryKey, updater);
516+
};
517+
448518
export const typesQueryKey = (options: Options<TypesData>) => createQueryKey('types', options);
449519

450520
export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesResponse, DefaultError, TypesResponse, ReturnType<typeof typesQueryKey>>({
@@ -460,6 +530,13 @@ export const typesOptions = (options: Options<TypesData>) => queryOptions<TypesR
460530
queryKey: typesQueryKey(options)
461531
});
462532

533+
export const useTypesQuery = (options: Options<TypesData>) => useQuery(typesOptions(options));
534+
535+
export const useTypesSetQueryData = () => {
536+
const queryClient = useQueryClient();
537+
return (updater: TypesResponse | undefined | ((old: TypesResponse | undefined) => TypesResponse | undefined), options: Options<TypesData>) => queryClient.setQueryData(typesOptions(options).queryKey, updater);
538+
};
539+
463540
export const complexTypesQueryKey = (options: Options<ComplexTypesData>) => createQueryKey('complexTypes', options);
464541

465542
export const complexTypesOptions = (options: Options<ComplexTypesData>) => queryOptions<ComplexTypesResponse, DefaultError, ComplexTypesResponse, ReturnType<typeof complexTypesQueryKey>>({
@@ -475,6 +552,13 @@ export const complexTypesOptions = (options: Options<ComplexTypesData>) => query
475552
queryKey: complexTypesQueryKey(options)
476553
});
477554

555+
export const useComplexTypesQuery = (options: Options<ComplexTypesData>) => useQuery(complexTypesOptions(options));
556+
557+
export const useComplexTypesSetQueryData = () => {
558+
const queryClient = useQueryClient();
559+
return (updater: ComplexTypesResponse | undefined | ((old: ComplexTypesResponse | undefined) => ComplexTypesResponse | undefined), options: Options<ComplexTypesData>) => queryClient.setQueryData(complexTypesOptions(options).queryKey, updater);
560+
};
561+
478562
export const callWithResultFromHeaderMutation = (options?: Partial<Options<CallWithResultFromHeaderData>>): UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> => {
479563
const mutationOptions: UseMutationOptions<unknown, DefaultError, Options<CallWithResultFromHeaderData>> = {
480564
mutationFn: async (fnOptions) => {

0 commit comments

Comments
 (0)