diff --git a/.changeset/silver-donkeys-peel.md b/.changeset/silver-donkeys-peel.md new file mode 100644 index 0000000000..e575c695a5 --- /dev/null +++ b/.changeset/silver-donkeys-peel.md @@ -0,0 +1,5 @@ +--- +"@hey-api/openapi-ts": minor +--- + +make query key functions accept optional partial options for prefix matching diff --git a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts index 084e544878..9457f8bd4e 100644 --- a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts +++ b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/@tanstack/angular-query-experimental.gen.ts @@ -121,7 +121,7 @@ export type QueryKey = [ const createQueryKey = ( id: string, - options?: TOptions, + options?: Partial, infinite?: boolean, tags?: ReadonlyArray, ): [QueryKey[0]] => { @@ -150,7 +150,7 @@ const createQueryKey = ( return [params]; }; -export const findPetsByStatusQueryKey = (options: Options) => +export const findPetsByStatusQueryKey = (options?: Partial>) => createQueryKey('findPetsByStatus', options); /** @@ -177,7 +177,7 @@ export const findPetsByStatusOptions = (options: Options) queryKey: findPetsByStatusQueryKey(options), }); -export const findPetsByTagsQueryKey = (options: Options) => +export const findPetsByTagsQueryKey = (options?: Partial>) => createQueryKey('findPetsByTags', options); /** @@ -225,7 +225,7 @@ export const deletePetMutation = ( return mutationOptions; }; -export const getPetByIdQueryKey = (options: Options) => +export const getPetByIdQueryKey = (options?: Partial>) => createQueryKey('getPetById', options); /** @@ -302,7 +302,7 @@ export const uploadFileMutation = ( return mutationOptions; }; -export const getInventoryQueryKey = (options?: Options) => +export const getInventoryQueryKey = (options?: Partial>) => createQueryKey('getInventory', options); /** @@ -375,7 +375,7 @@ export const deleteOrderMutation = ( return mutationOptions; }; -export const getOrderByIdQueryKey = (options: Options) => +export const getOrderByIdQueryKey = (options?: Partial>) => createQueryKey('getOrderById', options); /** @@ -456,7 +456,7 @@ export const createUsersWithListInputMutation = ( return mutationOptions; }; -export const loginUserQueryKey = (options?: Options) => +export const loginUserQueryKey = (options?: Partial>) => createQueryKey('loginUser', options); /** @@ -483,7 +483,7 @@ export const loginUserOptions = (options?: Options) => queryKey: loginUserQueryKey(options), }); -export const logoutUserQueryKey = (options?: Options) => +export const logoutUserQueryKey = (options?: Partial>) => createQueryKey('logoutUser', options); /** @@ -526,7 +526,7 @@ export const deleteUserMutation = ( return mutationOptions; }; -export const getUserByNameQueryKey = (options: Options) => +export const getUserByNameQueryKey = (options?: Partial>) => createQueryKey('getUserByName', options); /** diff --git a/examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts b/examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts index dc04163d5c..443129f025 100644 --- a/examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts +++ b/examples/openapi-ts-tanstack-react-query/src/client/@tanstack/react-query.gen.ts @@ -96,7 +96,7 @@ export type QueryKey = [ const createQueryKey = ( id: string, - options?: TOptions, + options?: Partial, infinite?: boolean, tags?: ReadonlyArray, ): [QueryKey[0]] => { @@ -125,7 +125,7 @@ const createQueryKey = ( return [params]; }; -export const findPetsByStatusQueryKey = (options: Options) => +export const findPetsByStatusQueryKey = (options?: Partial>) => createQueryKey('findPetsByStatus', options); /** @@ -152,7 +152,7 @@ export const findPetsByStatusOptions = (options: Options) queryKey: findPetsByStatusQueryKey(options), }); -export const findPetsByTagsQueryKey = (options: Options) => +export const findPetsByTagsQueryKey = (options?: Partial>) => createQueryKey('findPetsByTags', options); /** @@ -200,7 +200,7 @@ export const deletePetMutation = ( return mutationOptions; }; -export const getPetByIdQueryKey = (options: Options) => +export const getPetByIdQueryKey = (options?: Partial>) => createQueryKey('getPetById', options); /** @@ -277,7 +277,7 @@ export const uploadFileMutation = ( return mutationOptions; }; -export const getInventoryQueryKey = (options?: Options) => +export const getInventoryQueryKey = (options?: Partial>) => createQueryKey('getInventory', options); /** @@ -350,7 +350,7 @@ export const deleteOrderMutation = ( return mutationOptions; }; -export const getOrderByIdQueryKey = (options: Options) => +export const getOrderByIdQueryKey = (options?: Partial>) => createQueryKey('getOrderById', options); /** @@ -431,7 +431,7 @@ export const createUsersWithListInputMutation = ( return mutationOptions; }; -export const loginUserQueryKey = (options?: Options) => +export const loginUserQueryKey = (options?: Partial>) => createQueryKey('loginUser', options); /** @@ -458,7 +458,7 @@ export const loginUserOptions = (options?: Options) => queryKey: loginUserQueryKey(options), }); -export const logoutUserQueryKey = (options?: Options) => +export const logoutUserQueryKey = (options?: Partial>) => createQueryKey('logoutUser', options); /** @@ -501,7 +501,7 @@ export const deleteUserMutation = ( return mutationOptions; }; -export const getUserByNameQueryKey = (options: Options) => +export const getUserByNameQueryKey = (options?: Partial>) => createQueryKey('getUserByName', options); /** diff --git a/examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts b/examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts index 2f8ca16f8d..1f5622f2dc 100644 --- a/examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts +++ b/examples/openapi-ts-tanstack-svelte-query/src/client/@tanstack/svelte-query.gen.ts @@ -117,7 +117,7 @@ export type QueryKey = [ const createQueryKey = ( id: string, - options?: TOptions, + options?: Partial, infinite?: boolean, tags?: ReadonlyArray, ): [QueryKey[0]] => { @@ -146,7 +146,7 @@ const createQueryKey = ( return [params]; }; -export const findPetsByStatusQueryKey = (options: Options) => +export const findPetsByStatusQueryKey = (options?: Partial>) => createQueryKey('findPetsByStatus', options); /** @@ -173,7 +173,7 @@ export const findPetsByStatusOptions = (options: Options) queryKey: findPetsByStatusQueryKey(options), }); -export const findPetsByTagsQueryKey = (options: Options) => +export const findPetsByTagsQueryKey = (options?: Partial>) => createQueryKey('findPetsByTags', options); /** @@ -221,7 +221,7 @@ export const deletePetMutation = ( return mutationOptions; }; -export const getPetByIdQueryKey = (options: Options) => +export const getPetByIdQueryKey = (options?: Partial>) => createQueryKey('getPetById', options); /** @@ -298,7 +298,7 @@ export const uploadFileMutation = ( return mutationOptions; }; -export const getInventoryQueryKey = (options?: Options) => +export const getInventoryQueryKey = (options?: Partial>) => createQueryKey('getInventory', options); /** @@ -371,7 +371,7 @@ export const deleteOrderMutation = ( return mutationOptions; }; -export const getOrderByIdQueryKey = (options: Options) => +export const getOrderByIdQueryKey = (options?: Partial>) => createQueryKey('getOrderById', options); /** @@ -452,7 +452,7 @@ export const createUsersWithListInputMutation = ( return mutationOptions; }; -export const loginUserQueryKey = (options?: Options) => +export const loginUserQueryKey = (options?: Partial>) => createQueryKey('loginUser', options); /** @@ -479,7 +479,7 @@ export const loginUserOptions = (options?: Options) => queryKey: loginUserQueryKey(options), }); -export const logoutUserQueryKey = (options?: Options) => +export const logoutUserQueryKey = (options?: Partial>) => createQueryKey('logoutUser', options); /** @@ -522,7 +522,7 @@ export const deleteUserMutation = ( return mutationOptions; }; -export const getUserByNameQueryKey = (options: Options) => +export const getUserByNameQueryKey = (options?: Partial>) => createQueryKey('getUserByName', options); /** diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts b/examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts index 06084d7522..27a04ee1d0 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/@tanstack/vue-query.gen.ts @@ -117,7 +117,7 @@ export type QueryKey = [ const createQueryKey = ( id: string, - options?: TOptions, + options?: Partial, infinite?: boolean, tags?: ReadonlyArray, ): [QueryKey[0]] => { @@ -146,7 +146,7 @@ const createQueryKey = ( return [params]; }; -export const findPetsByStatusQueryKey = (options: Options) => +export const findPetsByStatusQueryKey = (options?: Partial>) => createQueryKey('findPetsByStatus', options); /** @@ -173,7 +173,7 @@ export const findPetsByStatusOptions = (options: Options) queryKey: findPetsByStatusQueryKey(options), }); -export const findPetsByTagsQueryKey = (options: Options) => +export const findPetsByTagsQueryKey = (options?: Partial>) => createQueryKey('findPetsByTags', options); /** @@ -221,7 +221,7 @@ export const deletePetMutation = ( return mutationOptions; }; -export const getPetByIdQueryKey = (options: Options) => +export const getPetByIdQueryKey = (options?: Partial>) => createQueryKey('getPetById', options); /** @@ -298,7 +298,7 @@ export const uploadFileMutation = ( return mutationOptions; }; -export const getInventoryQueryKey = (options?: Options) => +export const getInventoryQueryKey = (options?: Partial>) => createQueryKey('getInventory', options); /** @@ -371,7 +371,7 @@ export const deleteOrderMutation = ( return mutationOptions; }; -export const getOrderByIdQueryKey = (options: Options) => +export const getOrderByIdQueryKey = (options?: Partial>) => createQueryKey('getOrderById', options); /** @@ -452,7 +452,7 @@ export const createUsersWithListInputMutation = ( return mutationOptions; }; -export const loginUserQueryKey = (options?: Options) => +export const loginUserQueryKey = (options?: Partial>) => createQueryKey('loginUser', options); /** @@ -479,7 +479,7 @@ export const loginUserOptions = (options?: Options) => queryKey: loginUserQueryKey(options), }); -export const logoutUserQueryKey = (options?: Options) => +export const logoutUserQueryKey = (options?: Partial>) => createQueryKey('logoutUser', options); /** @@ -522,7 +522,7 @@ export const deleteUserMutation = ( return mutationOptions; }; -export const getUserByNameQueryKey = (options: Options) => +export const getUserByNameQueryKey = (options?: Partial>) => createQueryKey('getUserByName', options); /** diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts index ac5127274b..cf02bed0ee 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/preact-query.gen.ts index 92fa2c6b00..2043ab0b04 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/react-query.gen.ts index 486657ead7..5887939d12 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/solid-query.gen.ts index d5594064cc..727bd82285 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts index 3e29275971..63dbd28ba3 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/vue-query.gen.ts index 2e82ca3558..1d0f0df8b7 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/asClass/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts index cef8fd3635..37abe8dd17 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/preact-query.gen.ts index 3bf40b1ad0..44bb1acd91 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/preact-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/react-query.gen.ts index da398d1700..546c33de9f 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/react-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/solid-query.gen.ts index 7a51e436a3..2fbd5cfd72 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/solid-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/svelte-query.gen.ts index 8900d4a581..3e6020411b 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/svelte-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/vue-query.gen.ts index 5a5ce3b118..728a29fcc0 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/axios/@tanstack/vue-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -196,7 +196,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -253,7 +253,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -296,7 +296,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -311,7 +311,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -326,7 +326,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -341,7 +341,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -356,7 +356,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -399,7 +399,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -414,7 +414,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -429,7 +429,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts index 5087360ef7..268930c565 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/preact-query.gen.ts index c3a6821f4c..043e9306b6 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/react-query.gen.ts index ef023fe2c6..ba2c99ed45 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/solid-query.gen.ts index c4092a30b9..15a99c5242 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts index e14c0d70c0..820d8c5aeb 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/vue-query.gen.ts index b545d18172..f17128c2e6 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/fetch/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -195,7 +195,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -252,7 +252,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -295,7 +295,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -310,7 +310,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -325,7 +325,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -340,7 +340,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -355,7 +355,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -398,7 +398,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -413,7 +413,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -428,7 +428,7 @@ export const typesOptions = (options: Options) => queryOptions) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/full-config/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/full-config/@tanstack/react-query.gen.ts index 0e0db940ce..9bb9bdd5eb 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/full-config/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/full-config/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const serviceWithEmptyTagQueryKey = (options?: Options) => createQueryKey('serviceWithEmptyTag', options); +export const serviceWithEmptyTagQueryKey = (options?: Partial>) => createQueryKey('serviceWithEmptyTag', options); export const serviceWithEmptyTagOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -156,7 +156,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial export const useDeleteCallWithoutParametersAndResponseMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...deleteCallWithoutParametersAndResponseMutation(), ...mutationOptions }); -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -301,7 +301,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithWeirdParameterNamesMutation(), ...mutationOptions }); -export const callWithDefaultParametersQueryKey = (options: Options) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -389,7 +389,7 @@ export const duplicateNameMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateNameMutation(), ...mutationOptions }); -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -458,7 +458,7 @@ export const duplicateName4Mutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateName4Mutation(), ...mutationOptions }); -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -489,7 +489,7 @@ export const useCallWithNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(callWithNoContentResponseOptions(options).queryKey, updater); }; -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -520,7 +520,7 @@ export const useCallWithResponseAndNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: CallWithResponseAndNoContentResponseResponse | undefined | ((old: CallWithResponseAndNoContentResponseResponse | undefined) => CallWithResponseAndNoContentResponseResponse | undefined)) => queryClient.setQueryData(callWithResponseAndNoContentResponseOptions(options).queryKey, updater); }; -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -551,7 +551,7 @@ export const useDummyASetQueryData = () => { return (options: Options | undefined, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(dummyAOptions(options).queryKey, updater); }; -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -582,7 +582,7 @@ export const useDummyBSetQueryData = () => { return (options: Options | undefined, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(dummyBOptions(options).queryKey, updater); }; -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -651,7 +651,7 @@ export const callWithResponsesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithResponsesMutation(), ...mutationOptions }); -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -682,7 +682,7 @@ export const useCollectionFormatSetQueryData = () => { return (options: Options, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(collectionFormatOptions(options).queryKey, updater); }; -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -713,7 +713,7 @@ export const useTypesSetQueryData = () => { return (options: Options, updater: TypesResponse | undefined | ((old: TypesResponse | undefined) => TypesResponse | undefined)) => queryClient.setQueryData(typesOptions(options).queryKey, updater); }; -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts index b144ed7a2c..a82be512a0 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts index 5552d69766..1026823e5b 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/react-query.gen.ts index 43c90277c2..29fdd329ba 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts index ba1febdda4..02e6e02e59 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts index 6a831b5b3e..c9ca318a62 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts index bfd35f1d62..8d76c300b9 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/2.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts index c7e01dadfe..2f74e7a582 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/internal-name-conflict/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); +export const createQueryKey2 = (options?: Partial>) => createQueryKey('create', options); export const createOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts index ac5127274b..cf02bed0ee 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/preact-query.gen.ts index 92fa2c6b00..2043ab0b04 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/react-query.gen.ts index 486657ead7..5887939d12 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/solid-query.gen.ts index d5594064cc..727bd82285 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts index 3e29275971..63dbd28ba3 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/vue-query.gen.ts index 2e82ca3558..1d0f0df8b7 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/asClass/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts index 5b07cde6a8..1df7619f32 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/preact-query.gen.ts index 586296750d..91bb729361 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/preact-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/react-query.gen.ts index 38403265b8..dd0467c6bf 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/react-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/solid-query.gen.ts index 203534a865..54482e0738 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/solid-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/svelte-query.gen.ts index 9e78e66d27..21fc03845f 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/svelte-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/vue-query.gen.ts index f839621a3d..7a74fcb995 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/axios/@tanstack/vue-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts index 6cc80fb17d..96a6a9bebe 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/preact-query.gen.ts index 33d1fb83e9..52c93238e6 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/react-query.gen.ts index 378082bd09..ce843d30d1 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/solid-query.gen.ts index 358caac28f..b56465b730 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts index 7e81c37313..4c9112bffd 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/vue-query.gen.ts index bbcab4d5a3..296b00100a 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/fetch/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/full-config/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/full-config/@tanstack/react-query.gen.ts index 32a7c7cf24..c8b6557618 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/full-config/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/full-config/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -156,7 +156,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat export const useFooWowMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...fooWowMutation(), ...mutationOptions }); -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -187,7 +187,7 @@ export const useApiVVersionODataControllerCountSetQueryData = () => { return (options: Options | undefined, updater: ApiVVersionODataControllerCountResponse | undefined | ((old: ApiVVersionODataControllerCountResponse | undefined) => ApiVVersionODataControllerCountResponse | undefined)) => queryClient.setQueryData(apiVVersionODataControllerCountOptions(options).queryKey, updater); }; -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -237,7 +237,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial export const useDeleteCallWithoutParametersAndResponseMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...deleteCallWithoutParametersAndResponseMutation(), ...mutationOptions }); -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -426,7 +426,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithWeirdParameterNamesMutation(), ...mutationOptions }); -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -470,7 +470,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -567,7 +567,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...postApiVbyApiVersionFormDataMutation(), ...mutationOptions }); -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -655,7 +655,7 @@ export const duplicateNameMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateNameMutation(), ...mutationOptions }); -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -724,7 +724,7 @@ export const duplicateName4Mutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateName4Mutation(), ...mutationOptions }); -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -755,7 +755,7 @@ export const useCallWithNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: CallWithNoContentResponseResponse | undefined | ((old: CallWithNoContentResponseResponse | undefined) => CallWithNoContentResponseResponse | undefined)) => queryClient.setQueryData(callWithNoContentResponseOptions(options).queryKey, updater); }; -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -786,7 +786,7 @@ export const useCallWithResponseAndNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: CallWithResponseAndNoContentResponseResponse | undefined | ((old: CallWithResponseAndNoContentResponseResponse | undefined) => CallWithResponseAndNoContentResponseResponse | undefined)) => queryClient.setQueryData(callWithResponseAndNoContentResponseOptions(options).queryKey, updater); }; -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -817,7 +817,7 @@ export const useDummyASetQueryData = () => { return (options: Options | undefined, updater: DummyAResponse | undefined | ((old: DummyAResponse | undefined) => DummyAResponse | undefined)) => queryClient.setQueryData(dummyAOptions(options).queryKey, updater); }; -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -848,7 +848,7 @@ export const useDummyBSetQueryData = () => { return (options: Options | undefined, updater: DummyBResponse | undefined | ((old: DummyBResponse | undefined) => DummyBResponse | undefined)) => queryClient.setQueryData(dummyBOptions(options).queryKey, updater); }; -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -917,7 +917,7 @@ export const callWithResponsesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithResponsesMutation(), ...mutationOptions }); -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -948,7 +948,7 @@ export const useCollectionFormatSetQueryData = () => { return (options: Options, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(collectionFormatOptions(options).queryKey, updater); }; -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -998,7 +998,7 @@ export const uploadFileMutation = (options?: Partial>): export const useUploadFileMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...uploadFileMutation(), ...mutationOptions }); -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -1029,7 +1029,7 @@ export const useFileResponseSetQueryData = () => { return (options: Options, updater: FileResponseResponse | undefined | ((old: FileResponseResponse | undefined) => FileResponseResponse | undefined)) => queryClient.setQueryData(fileResponseOptions(options).queryKey, updater); }; -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -1060,7 +1060,7 @@ export const useComplexTypesSetQueryData = () => { return (options: Options, updater: ComplexTypesResponse | undefined | ((old: ComplexTypesResponse | undefined) => ComplexTypesResponse | undefined)) => queryClient.setQueryData(complexTypesOptions(options).queryKey, updater); }; -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts index b144ed7a2c..a82be512a0 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts index 5552d69766..1026823e5b 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/react-query.gen.ts index 43c90277c2..29fdd329ba 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts index ba1febdda4..02e6e02e59 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts index 6a831b5b3e..c9ca318a62 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts index bfd35f1d62..8d76c300b9 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.0.x/plugins/name-builder/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts index c7e01dadfe..2f74e7a582 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/internal-name-conflict/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const createQueryKey2 = (options?: Options) => createQueryKey('create', options); +export const createQueryKey2 = (options?: Partial>) => createQueryKey('create', options); export const createOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/angular-query-experimental/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/angular-query-experimental/@tanstack/angular-query-experimental.gen.ts index a168141ebe..03892b7688 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/angular-query-experimental/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/angular-query-experimental/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/preact-query/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/preact-query/@tanstack/preact-query.gen.ts index b0865adccf..973ceef2de 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/preact-query/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/preact-query/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/react-query/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/react-query/@tanstack/react-query.gen.ts index 5a6a250348..bcc4f845ed 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/react-query/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/react-query/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/solid-query/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/solid-query/@tanstack/solid-query.gen.ts index 8b6d32356b..bdc92ac8d0 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/solid-query/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/solid-query/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/svelte-query/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/svelte-query/@tanstack/svelte-query.gen.ts index 4c50bd6203..5323cc7bb9 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/svelte-query/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/svelte-query/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/vue-query/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/vue-query/@tanstack/vue-query.gen.ts index 4793f41da5..9551ef0c6a 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/vue-query/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/meta-function/vue-query/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -59,7 +59,7 @@ export const getFooOptions = (options?: Options) => queryOptions) => createQueryKey('getBar', options); +export const getBarQueryKey = (options?: Partial>) => createQueryKey('getBar', options); export const getBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/pagination-ref/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/pagination-ref/@tanstack/react-query.gen.ts index b9e75835bb..c0caaa6d76 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/pagination-ref/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/pagination-ref/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -83,7 +83,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getFooInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getFoo', options, true); +export const getFooInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getFoo', options, true); export const getFooInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | null | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts index ac5127274b..cf02bed0ee 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/preact-query.gen.ts index 92fa2c6b00..2043ab0b04 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/react-query.gen.ts index 486657ead7..5887939d12 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/solid-query.gen.ts index d5594064cc..727bd82285 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/svelte-query.gen.ts index 3e29275971..63dbd28ba3 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/vue-query.gen.ts index 2e82ca3558..1d0f0df8b7 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/asClass/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooQueryKey = (options?: Options) => createQueryKey('getFoo', options); +export const getFooQueryKey = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const getFooBarQueryKey = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarQueryKey = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts index 5b07cde6a8..1df7619f32 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/angular-query-experimental.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/preact-query.gen.ts index 586296750d..91bb729361 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/preact-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/react-query.gen.ts index 38403265b8..dd0467c6bf 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/react-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/solid-query.gen.ts index 203534a865..54482e0738 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/solid-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/svelte-query.gen.ts index 9e78e66d27..21fc03845f 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/svelte-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/vue-query.gen.ts index f839621a3d..7a74fcb995 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/axios/@tanstack/vue-query.gen.ts @@ -15,7 +15,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseURL: options?.baseURL || (options?.client ?? client).getConfig().baseURL } as QueryKey[0]; @@ -40,7 +40,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -97,7 +97,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions, ApiVVersionODataControllerCountResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -112,7 +112,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions, GetApiVbyApiVersionSimpleOperationResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -141,7 +141,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -271,7 +271,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -315,7 +315,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, InfiniteData, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -381,7 +381,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -438,7 +438,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -481,7 +481,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions, CallWithNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -496,7 +496,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions, CallWithResponseAndNoContentResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -511,7 +511,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions, DummyAResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -526,7 +526,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions, DummyBResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -541,7 +541,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions, CallWithResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -584,7 +584,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions, unknown, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -599,7 +599,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions, TypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -628,7 +628,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions, FileResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -643,7 +643,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions, ComplexTypesResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { @@ -658,7 +658,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions, MultipartResponseResponse, ReturnType>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts index 6cc80fb17d..96a6a9bebe 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/preact-query.gen.ts index 33d1fb83e9..52c93238e6 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/react-query.gen.ts index 378082bd09..ce843d30d1 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/solid-query.gen.ts index 358caac28f..b56465b730 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/svelte-query.gen.ts index 7e81c37313..4c9112bffd 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): Mutation return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/vue-query.gen.ts index bbcab4d5a3..296b00100a 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/fetch/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -96,7 +96,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat return mutationOptions; }; -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -111,7 +111,7 @@ export const apiVVersionODataControllerCountOptions = (options?: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -140,7 +140,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial return mutationOptions; }; -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -270,7 +270,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -314,7 +314,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -380,7 +380,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -437,7 +437,7 @@ export const duplicateNameMutation = (options?: Partial) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -480,7 +480,7 @@ export const duplicateName4Mutation = (options?: Partial) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -495,7 +495,7 @@ export const callWithNoContentResponseOptions = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -510,7 +510,7 @@ export const callWithResponseAndNoContentResponseOptions = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -525,7 +525,7 @@ export const dummyAOptions = (options?: Options) => queryOptions) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -540,7 +540,7 @@ export const dummyBOptions = (options?: Options) => queryOptions) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -583,7 +583,7 @@ export const callWithResponsesMutation = (options?: Partial) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -598,7 +598,7 @@ export const collectionFormatOptions = (options: Options) queryKey: collectionFormatQueryKey(options) }); -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -627,7 +627,7 @@ export const uploadFileMutation = (options?: Partial>): return mutationOptions; }; -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -642,7 +642,7 @@ export const fileResponseOptions = (options: Options) => query queryKey: fileResponseQueryKey(options) }); -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -657,7 +657,7 @@ export const complexTypesOptions = (options: Options) => query queryKey: complexTypesQueryKey(options) }); -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/full-config/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/full-config/@tanstack/react-query.gen.ts index 32a7c7cf24..c8b6557618 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/full-config/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/full-config/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const exportQueryKey = (options?: Options) => createQueryKey('export', options); +export const exportQueryKey = (options?: Partial>) => createQueryKey('export', options); export const exportOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -156,7 +156,7 @@ export const fooWowMutation = (options?: Partial>): UseMutat export const useFooWowMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...fooWowMutation(), ...mutationOptions }); -export const apiVVersionODataControllerCountQueryKey = (options?: Options) => createQueryKey('apiVVersionODataControllerCount', options); +export const apiVVersionODataControllerCountQueryKey = (options?: Partial>) => createQueryKey('apiVVersionODataControllerCount', options); export const apiVVersionODataControllerCountOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -187,7 +187,7 @@ export const useApiVVersionODataControllerCountSetQueryData = () => { return (options: Options | undefined, updater: ApiVVersionODataControllerCountResponse | undefined | ((old: ApiVVersionODataControllerCountResponse | undefined) => ApiVVersionODataControllerCountResponse | undefined)) => queryClient.setQueryData(apiVVersionODataControllerCountOptions(options).queryKey, updater); }; -export const getApiVbyApiVersionSimpleOperationQueryKey = (options: Options) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); +export const getApiVbyApiVersionSimpleOperationQueryKey = (options?: Partial>) => createQueryKey('getApiVbyApiVersionSimpleOperation', options); export const getApiVbyApiVersionSimpleOperationOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -237,7 +237,7 @@ export const deleteCallWithoutParametersAndResponseMutation = (options?: Partial export const useDeleteCallWithoutParametersAndResponseMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...deleteCallWithoutParametersAndResponseMutation(), ...mutationOptions }); -export const getCallWithoutParametersAndResponseQueryKey = (options?: Options) => createQueryKey('getCallWithoutParametersAndResponse', options); +export const getCallWithoutParametersAndResponseQueryKey = (options?: Partial>) => createQueryKey('getCallWithoutParametersAndResponse', options); export const getCallWithoutParametersAndResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -426,7 +426,7 @@ export const callWithWeirdParameterNamesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithWeirdParameterNamesMutation(), ...mutationOptions }); -export const getCallWithOptionalParamQueryKey = (options: Options) => createQueryKey('getCallWithOptionalParam', options); +export const getCallWithOptionalParamQueryKey = (options?: Partial>) => createQueryKey('getCallWithOptionalParam', options); export const getCallWithOptionalParamOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -470,7 +470,7 @@ const createInfiniteParams = [0], 'body' | 'hea return params as unknown as typeof page; }; -export const getCallWithOptionalParamInfiniteQueryKey = (options: Options): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); +export const getCallWithOptionalParamInfiniteQueryKey = (options?: Partial>): QueryKey> => createQueryKey('getCallWithOptionalParam', options, true); export const getCallWithOptionalParamInfiniteOptions = (options: Options) => infiniteQueryOptions, QueryKey>, number | Pick>[0], 'body' | 'headers' | 'path' | 'query'>>( // @ts-ignore @@ -567,7 +567,7 @@ export const postApiVbyApiVersionFormDataMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...postApiVbyApiVersionFormDataMutation(), ...mutationOptions }); -export const callWithDefaultParametersQueryKey = (options?: Options) => createQueryKey('callWithDefaultParameters', options); +export const callWithDefaultParametersQueryKey = (options?: Partial>) => createQueryKey('callWithDefaultParameters', options); export const callWithDefaultParametersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -655,7 +655,7 @@ export const duplicateNameMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateNameMutation(), ...mutationOptions }); -export const duplicateName2QueryKey = (options?: Options) => createQueryKey('duplicateName2', options); +export const duplicateName2QueryKey = (options?: Partial>) => createQueryKey('duplicateName2', options); export const duplicateName2Options = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -724,7 +724,7 @@ export const duplicateName4Mutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...duplicateName4Mutation(), ...mutationOptions }); -export const callWithNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithNoContentResponse', options); +export const callWithNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithNoContentResponse', options); export const callWithNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -755,7 +755,7 @@ export const useCallWithNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: CallWithNoContentResponseResponse | undefined | ((old: CallWithNoContentResponseResponse | undefined) => CallWithNoContentResponseResponse | undefined)) => queryClient.setQueryData(callWithNoContentResponseOptions(options).queryKey, updater); }; -export const callWithResponseAndNoContentResponseQueryKey = (options?: Options) => createQueryKey('callWithResponseAndNoContentResponse', options); +export const callWithResponseAndNoContentResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponseAndNoContentResponse', options); export const callWithResponseAndNoContentResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -786,7 +786,7 @@ export const useCallWithResponseAndNoContentResponseSetQueryData = () => { return (options: Options | undefined, updater: CallWithResponseAndNoContentResponseResponse | undefined | ((old: CallWithResponseAndNoContentResponseResponse | undefined) => CallWithResponseAndNoContentResponseResponse | undefined)) => queryClient.setQueryData(callWithResponseAndNoContentResponseOptions(options).queryKey, updater); }; -export const dummyAQueryKey = (options?: Options) => createQueryKey('dummyA', options); +export const dummyAQueryKey = (options?: Partial>) => createQueryKey('dummyA', options); export const dummyAOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -817,7 +817,7 @@ export const useDummyASetQueryData = () => { return (options: Options | undefined, updater: DummyAResponse | undefined | ((old: DummyAResponse | undefined) => DummyAResponse | undefined)) => queryClient.setQueryData(dummyAOptions(options).queryKey, updater); }; -export const dummyBQueryKey = (options?: Options) => createQueryKey('dummyB', options); +export const dummyBQueryKey = (options?: Partial>) => createQueryKey('dummyB', options); export const dummyBOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -848,7 +848,7 @@ export const useDummyBSetQueryData = () => { return (options: Options | undefined, updater: DummyBResponse | undefined | ((old: DummyBResponse | undefined) => DummyBResponse | undefined)) => queryClient.setQueryData(dummyBOptions(options).queryKey, updater); }; -export const callWithResponseQueryKey = (options?: Options) => createQueryKey('callWithResponse', options); +export const callWithResponseQueryKey = (options?: Partial>) => createQueryKey('callWithResponse', options); export const callWithResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -917,7 +917,7 @@ export const callWithResponsesMutation = (options?: Partial>, 'mutationFn'>>) => useMutation({ ...callWithResponsesMutation(), ...mutationOptions }); -export const collectionFormatQueryKey = (options: Options) => createQueryKey('collectionFormat', options); +export const collectionFormatQueryKey = (options?: Partial>) => createQueryKey('collectionFormat', options); export const collectionFormatOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -948,7 +948,7 @@ export const useCollectionFormatSetQueryData = () => { return (options: Options, updater: unknown | undefined | ((old: unknown | undefined) => unknown | undefined)) => queryClient.setQueryData(collectionFormatOptions(options).queryKey, updater); }; -export const typesQueryKey = (options: Options) => createQueryKey('types', options); +export const typesQueryKey = (options?: Partial>) => createQueryKey('types', options); export const typesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -998,7 +998,7 @@ export const uploadFileMutation = (options?: Partial>): export const useUploadFileMutation = (mutationOptions?: Partial>, 'mutationFn'>>) => useMutation({ ...uploadFileMutation(), ...mutationOptions }); -export const fileResponseQueryKey = (options: Options) => createQueryKey('fileResponse', options); +export const fileResponseQueryKey = (options?: Partial>) => createQueryKey('fileResponse', options); export const fileResponseOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -1029,7 +1029,7 @@ export const useFileResponseSetQueryData = () => { return (options: Options, updater: FileResponseResponse | undefined | ((old: FileResponseResponse | undefined) => FileResponseResponse | undefined)) => queryClient.setQueryData(fileResponseOptions(options).queryKey, updater); }; -export const complexTypesQueryKey = (options: Options) => createQueryKey('complexTypes', options); +export const complexTypesQueryKey = (options?: Partial>) => createQueryKey('complexTypes', options); export const complexTypesOptions = (options: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -1060,7 +1060,7 @@ export const useComplexTypesSetQueryData = () => { return (options: Options, updater: ComplexTypesResponse | undefined | ((old: ComplexTypesResponse | undefined) => ComplexTypesResponse | undefined)) => queryClient.setQueryData(complexTypesOptions(options).queryKey, updater); }; -export const multipartResponseQueryKey = (options?: Options) => createQueryKey('multipartResponse', options); +export const multipartResponseQueryKey = (options?: Partial>) => createQueryKey('multipartResponse', options); export const multipartResponseOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts index b144ed7a2c..a82be512a0 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/angular-query-experimental.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/preact-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/preact-query.gen.ts index 5552d69766..1026823e5b 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/preact-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/preact-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/react-query.gen.ts index 43c90277c2..29fdd329ba 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/solid-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/solid-query.gen.ts index ba1febdda4..02e6e02e59 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/solid-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/solid-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/svelte-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/svelte-query.gen.ts index 6a831b5b3e..c9ca318a62 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/svelte-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/svelte-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): MutationOptions return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/vue-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/vue-query.gen.ts index bfd35f1d62..8d76c300b9 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/vue-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/plugins/name-builder/@tanstack/vue-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getFooD = (options?: Options) => createQueryKey('getFoo', options); +export const getFooD = (options?: Partial>) => createQueryKey('getFoo', options); export const getFooE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -82,7 +82,7 @@ export const fooPutC = (options?: Partial>): UseMutationOpti return mutationOptions; }; -export const getFooBarD = (options?: Options) => createQueryKey('getFooBar', options); +export const getFooBarD = (options?: Partial>) => createQueryKey('getFooBar', options); export const getFooBarE = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/query-options-name-conflict/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/query-options-name-conflict/@tanstack/react-query.gen.ts index 1971217de4..9d71930b06 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/query-options-name-conflict/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/query-options-name-conflict/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const getMembersQueryKey = (options?: Options) => createQueryKey('getMembers', options); +export const getMembersQueryKey = (options?: Partial>) => createQueryKey('getMembers', options); export const getMembersOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { @@ -54,7 +54,7 @@ export const getMembersOptions = (options?: Options) => queryOpt queryKey: getMembersQueryKey(options) }); -export const getMembersOptionsQueryKey = (options?: Options) => createQueryKey('getMembersOptions', options); +export const getMembersOptionsQueryKey = (options?: Partial>) => createQueryKey('getMembersOptions', options); export const getMembersOptionsOptions = (options?: Options) => queryOptions>({ queryFn: async ({ queryKey, signal }) => { diff --git a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/sse-react-query/@tanstack/react-query.gen.ts b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/sse-react-query/@tanstack/react-query.gen.ts index 197e707f4c..528710d0b8 100644 --- a/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/sse-react-query/@tanstack/react-query.gen.ts +++ b/packages/openapi-ts-tests/tanstack-query/v5/__snapshots__/3.1.x/sse-react-query/@tanstack/react-query.gen.ts @@ -14,7 +14,7 @@ export type QueryKey = [ } ]; -const createQueryKey = (id: string, options?: TOptions, infinite?: boolean, tags?: ReadonlyArray): [ +const createQueryKey = (id: string, options?: Partial, infinite?: boolean, tags?: ReadonlyArray): [ QueryKey[0] ] => { const params: QueryKey[0] = { _id: id, baseUrl: options?.baseUrl || (options?.client ?? client).getConfig().baseUrl } as QueryKey[0]; @@ -39,7 +39,7 @@ const createQueryKey = (id: string, options?: TOptions return [params]; }; -export const listEventsQueryKey = (options?: Options) => createQueryKey('listEvents', options); +export const listEventsQueryKey = (options?: Partial>) => createQueryKey('listEvents', options); /** * List events diff --git a/packages/openapi-ts/src/plugins/@tanstack/query-core/queryKey.ts b/packages/openapi-ts/src/plugins/@tanstack/query-core/queryKey.ts index 707ac3f942..3d89e2a684 100644 --- a/packages/openapi-ts/src/plugins/@tanstack/query-core/queryKey.ts +++ b/packages/openapi-ts/src/plugins/@tanstack/query-core/queryKey.ts @@ -1,6 +1,6 @@ import type { Symbol } from '@hey-api/codegen-core'; import type { IR } from '@hey-api/shared'; -import { applyNaming, hasOperationDataRequired } from '@hey-api/shared'; +import { applyNaming } from '@hey-api/shared'; import { getTypedConfig } from '../../../config/utils'; import { getClientBaseUrlKey } from '../../../plugins/@hey-api/client-core/utils'; @@ -42,11 +42,12 @@ export function createQueryKeyFunction({ plugin }: { plugin: PluginInstance }): }); const returnType = $.type(symbolQueryKeyType).generic(TOptionsType).idx(0); + const partialType = $.type('Partial').generic(TOptionsType); const fn = $.const(symbolCreateQueryKey).assign( $.func() .param('id', (p) => p.type('string')) - .param('options', (p) => p.optional().type(TOptionsType)) + .param('options', (p) => p.optional().type(partialType)) .param('infinite', (p) => p.optional().type('boolean')) .param('tags', (p) => p.optional().type('ReadonlyArray')) .generic(TOptionsType, (g) => g.extends(symbolOptions)) @@ -172,11 +173,12 @@ export function queryKeyStatement({ typeQueryKey?: ReturnType; }): ReturnType { const typeData = useTypeData({ operation, plugin }); + const partialType = $.type('Partial').generic(typeData); const statement = $.const(symbol) .export() .assign( $.func() - .param('options', (p) => p.required(hasOperationDataRequired(operation)).type(typeData)) + .param('options', (p) => p.optional().type(partialType)) .$if(isInfinite && typeQueryKey, (f, v) => f.returns(v)) .do( createQueryKeyLiteral({