Tryout useClient #605
Annotations
20 errors and 4 warnings
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'findByTags':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'findByTags' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
- })
+ },
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options:
+ {
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData,
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'findByTagsPathParamsObject':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'findByTagsPathParamsObject' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
- })
+ },
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options:
+ {
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsBy
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'findByTagsWithZod':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'findByTagsWithZod' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
- })
+ },
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options:
+ {
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>,
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'findByTagsWithCustomQueryKey':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'findByTagsWithCustomQueryKey' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => ['test', { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => ["test", { url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
+ },
- })
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options:
+ {
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErro
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'clientGetImportPath':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'clientGetImportPath' 1` mismatched
- Expected
+ Received
- import client from 'axios'
+ import client from "axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import type { RequestConfig, ResponseErrorConfig } from 'axios'
+ import type { RequestConfig, ResponseErrorConfig } from "axios";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
- })
+ },
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, TQueryData = FindPetsByTagsQueryResponse, TQueryKey extends QueryKey = FindPetsByTagsQueryKey>(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, options:
+ {
- query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, TData, TQueryData, TQueryKey>>
+ query?: Partial<QueryObserverOptions<FindPetsByTagsQueryResponse, Respon
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'clientDataReturnTypeFull':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'clientDataReturnTypeFull' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig, ResponseConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return { ...res, data: findPetsByTagsQueryResponse.parse(res.data) }
+ return {...res, data: findPetsByTagsQueryResponse.parse(res.data)}
}
export function findPetsByTagsQueryOptions(headers: FindPetsByTagsHeaderParams, params?: FindPetsByTagsQueryParams, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<
- ResponseConfig<FindPetsByTagsQueryResponse>,
- ResponseErrorConfig<FindPetsByTags400>,
- ResponseConfig<FindPetsByTagsQueryResponse>,
- typeof queryKey
- >({
+ return queryOptions<ResponseConfig<FindPetsByTagsQueryResponse>, ResponseErrorConfig<FindPetsByTags400>, ResponseConfig<FindPetsByTagsQueryResponse>, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags(headers, params, config)
+ return findPetsByTags(headers, params, config)
- },
+ },
- })
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = ResponseConfig<FindPetsByTagsQueryResponse>,
- TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- headers: FindPetsByTagsHeaderParams,
- params?: FindPetsByTagsQueryParams,
- options: {
+ export function useFindPetsByTags<TData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryData = ResponseConfig<FindPetsByTagsQueryResponse>, TQueryKey extends Quer
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'postAsQuery':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'postAsQuery' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from 'custom-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "custom-query";
- import { queryOptions, useQuery } from 'custom-query'
+ import { queryOptions, useQuery } from "custom-query";
- export const updatePetWithFormQueryKey = (
- petId: UpdatePetWithFormPathParams['petId'],
- data?: UpdatePetWithFormMutationRequest,
- params?: UpdatePetWithFormQueryParams,
- ) => [{ url: '/pet/:pet_id', params: { pet_id: pet_id } }, ...(params ? [params] : []), ...(data ? [data] : [])] as const
+ export const updatePetWithFormQueryKey = (petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams) => [{ url: '/pet/:pet_id', params: {pet_id:pet_id} }, ...(params ? [params] : []), ...(data ? [data] : [])] as const
export type UpdatePetWithFormQueryKey = ReturnType<typeof updatePetWithFormQueryKey>
/**
* @summary Updates a pet in the store with form data
* {@link /pet/:pet_id}
*/
- export async function updatePetWithForm(
- petId: UpdatePetWithFormPathParams['petId'],
- data?: UpdatePetWithFormMutationRequest,
- params?: UpdatePetWithFormQueryParams,
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {},
- ) {
+ export async function updatePetWithForm(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({
- method: 'POST',
- url: `/pet/${pet_id}`,
- params,
- data,
- ...requestConfig,
- })
+ const res = await request<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationRequest>({ method : "POST", url : `/pet/${pet_id}`, params, data, ... requestConfig })
- return updatePetWithFormMutationResponse.parse(res.data)
+ return updatePetWithFormMutationResponse.parse(res.data)
}
- export function updatePetWithFormQueryOptions(
- petId: UpdatePetWithFormPathParams['petId'],
- data?: UpdatePetWithFormMutationRequest,
- params?: UpdatePetWithFormQueryParams,
- config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {},
- ) {
+ export function updatePetWithFormQueryOptions(petId: UpdatePetWithFormPathParams["petId"], data?: UpdatePetWithFormMutationRequest, params?: UpdatePetWithFormQueryParams, config: Partial<RequestConfig<UpdatePetWithFormMutationRequest>> = {}) {
- const queryKey = updatePetWithFormQueryKey(petId, data, params)
+ const queryKey = updatePetWithFormQueryKey(petId, data, params)
- return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
+ return queryOptions<UpdatePetWithFormMutationResponse, ResponseErrorConfig<UpdatePetWithForm405>, UpdatePetWithFormMutationResponse, typeof queryKey>({
- enabled: !!petId,
+ enabled: !!(petId),
- queryKey,
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return updatePetWithForm(petId, data, params, config)
+ return updatePetWithForm(petId, data, params, config)
- },
+ },
- })
+ }
}
/**
* @summary
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'findByTagsObject':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'findByTagsObject' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
+ export const findPetsByTagsQueryKey = (params?: FindPetsByTagsQueryParams) => [{ url: '/pet/findByTags' }, ...(params ? [params] : [])] as const
export type FindPetsByTagsQueryKey = ReturnType<typeof findPetsByTagsQueryKey>
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export async function findPetsByTags(
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
- config: Partial<RequestConfig> & { client?: typeof client } = {},
- ) {
+ export async function findPetsByTags({ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams }, config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({
- method: 'GET',
- url: `/pet/findByTags`,
- params,
- headers: { ...headers, ...requestConfig.headers },
- ...requestConfig,
- })
+ const res = await request<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, unknown>({ method : "GET", url : `/pet/findByTags`, params, headers : { ...headers, ...requestConfig.headers }, ... requestConfig })
- return findPetsByTagsQueryResponse.parse(res.data)
+ return findPetsByTagsQueryResponse.parse(res.data)
}
- export function findPetsByTagsQueryOptions(
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
- config: Partial<RequestConfig> = {},
- ) {
+ export function findPetsByTagsQueryOptions({ headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams }, config: Partial<RequestConfig> = {}) {
- const queryKey = findPetsByTagsQueryKey(params)
+ const queryKey = findPetsByTagsQueryKey(params)
- return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
+ return queryOptions<FindPetsByTagsQueryResponse, ResponseErrorConfig<FindPetsByTags400>, FindPetsByTagsQueryResponse, typeof queryKey>({
- queryKey,
+
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return findPetsByTags({ headers, params }, config)
+ return findPetsByTags({ headers, params }, config)
- },
+ },
- })
+ }
}
/**
* @description Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @summary Finds Pets by tags
* {@link /pet/findByTags}
*/
- export function useFindPetsByTags<
- TData = FindPetsByTagsQueryResponse,
- TQueryData = FindPetsByTagsQueryResponse,
- TQueryKey extends QueryKey = FindPetsByTagsQueryKey,
- >(
- { headers, params }: { headers: FindPetsByTagsHeaderParams; params?: FindPetsByTagsQueryParams },
- options: {
+ export function useFindPetsByTags<TData = FindPetsByTagsQueryResponse, T
|
packages/plugin-react-query/src/generators/queryGenerator.test.tsx > queryGenerator operation > 'getPetIdCamelCase':
packages/core/mocks/index.ts#L72
Error: Snapshot `queryGenerator operation > 'getPetIdCamelCase' 1` mismatched
- Expected
+ Received
- import client from '@kubb/plugin-client/clients/axios'
+ import client from "@kubb/plugin-client/clients/axios";
- import type { RequestConfig, ResponseErrorConfig } from '@kubb/plugin-client/clients/axios'
+ import type { RequestConfig, ResponseErrorConfig } from "@kubb/plugin-client/clients/axios";
- import type { QueryKey, QueryObserverOptions, UseQueryResult } from '@tanstack/react-query'
+ import type { QueryKey, QueryObserverOptions, UseQueryResult } from "@tanstack/react-query";
- import { queryOptions, useQuery } from '@tanstack/react-query'
+ import { queryOptions, useQuery } from "@tanstack/react-query";
- export const getPetByIdQueryKey = (petId: GetPetByIdPathParams['pet_id']) => [{ url: '/pet/:pet_id', params: { petId: petId } }] as const
+ export const getPetByIdQueryKey = (petId: GetPetByIdPathParams["pet_id"]) => [{ url: '/pet/:pet_id', params: {petId:petId} }] as const
export type GetPetByIdQueryKey = ReturnType<typeof getPetByIdQueryKey>
/**
* @description Returns a single pet
* @summary Find pet by ID
* {@link /pet/:pet_id}
*/
- export async function getPetById(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
+ export async function getPetById(petId: GetPetByIdPathParams["pet_id"], config: Partial<RequestConfig> & { client?: typeof client } = {}) {
const { client: request = client, ...requestConfig } = config
- const res = await request<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, unknown>({
- method: 'GET',
- url: `/pet/${petId}`,
- ...requestConfig,
- })
+ const res = await request<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, unknown>({ method : "GET", url : `/pet/${petId}`, ... requestConfig })
- return getPetByIdQueryResponse.parse(res.data)
+ return getPetByIdQueryResponse.parse(res.data)
}
- export function getPetByIdQueryOptions(petId: GetPetByIdPathParams['pet_id'], config: Partial<RequestConfig> = {}) {
+ export function getPetByIdQueryOptions(petId: GetPetByIdPathParams["pet_id"], config: Partial<RequestConfig> = {}) {
- const queryKey = getPetByIdQueryKey(petId)
+ const queryKey = getPetByIdQueryKey(petId)
- return queryOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, GetPetByIdQueryResponse, typeof queryKey>({
+ return queryOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, GetPetByIdQueryResponse, typeof queryKey>({
- enabled: !!petId,
+ enabled: !!(petId),
- queryKey,
+ queryKey,
- queryFn: async ({ signal }) => {
+ queryFn: async ({ signal }) => {
- config.signal = signal
+ config.signal = signal
- return getPetById(petId, config)
+ return getPetById(petId, config)
- },
- })
+ },
+ }
}
/**
* @description Returns a single pet
* @summary Find pet by ID
* {@link /pet/:pet_id}
*/
- export function useGetPetById<TData = GetPetByIdQueryResponse, TQueryData = GetPetByIdQueryResponse, TQueryKey extends QueryKey = GetPetByIdQueryKey>(
- petId: GetPetByIdPathParams['pet_id'],
- options: {
+ export function useGetPetById<TData = GetPetByIdQueryResponse, TQueryData = GetPetByIdQueryResponse, TQueryKey extends QueryKey = GetPetByIdQueryKey>(petId: GetPetByIdPathParams["pet_id"], options:
+ {
- query?: Partial<QueryObserverOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, TData, TQueryData, TQueryKey>>
+ query?: Partial<QueryObserverOptions<GetPetByIdQueryResponse, ResponseErrorConfig<GetPetById400 | GetPetById404>, TData, TQueryData, TQueryKey>>,
client?: Partial<RequestConfig>
- } = {},
- ) {
+ }
+ = {}) {
- const { query: queryOptions, client: config = {} } = options ?? {}
+
+ const { query: queryOptions, client: config = {} } = options ?? {}
- const q
|
Tests
Process completed with exit code 1.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Typecheck
',' expected.
|
Linting
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Build
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Tests
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Typecheck
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|