@openapi-qraft/react 2.7.2 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/cjs/callbacks/cancelQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/ensureInfiniteQueryData.cjs.map +1 -1
- package/dist/cjs/callbacks/ensureQueryData.cjs.map +1 -1
- package/dist/cjs/callbacks/fetchInfiniteQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/fetchQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/getInfiniteQueryData.cjs.map +1 -1
- package/dist/cjs/callbacks/getInfiniteQueryKey.cjs.map +1 -1
- package/dist/cjs/callbacks/getInfiniteQueryState.cjs.map +1 -1
- package/dist/cjs/callbacks/getMutationKey.cjs.map +1 -1
- package/dist/cjs/callbacks/getQueriesData.cjs.map +1 -1
- package/dist/cjs/callbacks/getQueryKey.cjs.map +1 -1
- package/dist/cjs/callbacks/getQueryState.cjs.map +1 -1
- package/dist/cjs/callbacks/invalidateQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/isFetching.cjs.map +1 -1
- package/dist/cjs/callbacks/isMutating.cjs.map +1 -1
- package/dist/cjs/callbacks/prefetchInfiniteQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/prefetchQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/refetchQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/removeQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/resetQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/setInfiniteQueryData.cjs.map +1 -1
- package/dist/cjs/callbacks/setQueriesData.cjs.map +1 -1
- package/dist/cjs/callbacks/useInfiniteQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/useIsFetching.cjs +1 -1
- package/dist/cjs/callbacks/useIsFetching.cjs.map +1 -1
- package/dist/cjs/callbacks/useIsMutating.cjs +1 -1
- package/dist/cjs/callbacks/useIsMutating.cjs.map +1 -1
- package/dist/cjs/callbacks/useMutation.cjs.map +1 -1
- package/dist/cjs/callbacks/useMutationState.cjs +1 -1
- package/dist/cjs/callbacks/useMutationState.cjs.map +1 -1
- package/dist/cjs/callbacks/useQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/useQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/useSuspenseInfiniteQuery.cjs.map +1 -1
- package/dist/cjs/callbacks/useSuspenseQueries.cjs.map +1 -1
- package/dist/cjs/callbacks/useSuspenseQuery.cjs.map +1 -1
- package/dist/cjs/lib/callQueryClientFetchMethod.cjs.map +1 -1
- package/dist/cjs/lib/callQueryClientMethodWithMutationFilters.cjs.map +1 -1
- package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.cjs.map +1 -1
- package/dist/cjs/lib/callQueryClientMethodWithQueryKey.cjs.map +1 -1
- package/dist/cjs/lib/useComposeUseQueryOptions.cjs.map +1 -1
- package/dist/cjs/qraftAPIClient.cjs +1 -1
- package/dist/cjs/qraftAPIClient.cjs.map +1 -1
- package/dist/esm/callbacks/cancelQueries.js.map +1 -1
- package/dist/esm/callbacks/ensureInfiniteQueryData.js.map +1 -1
- package/dist/esm/callbacks/ensureQueryData.js.map +1 -1
- package/dist/esm/callbacks/fetchInfiniteQuery.js.map +1 -1
- package/dist/esm/callbacks/fetchQuery.js.map +1 -1
- package/dist/esm/callbacks/getInfiniteQueryData.js.map +1 -1
- package/dist/esm/callbacks/getInfiniteQueryKey.js.map +1 -1
- package/dist/esm/callbacks/getInfiniteQueryState.js.map +1 -1
- package/dist/esm/callbacks/getMutationKey.js.map +1 -1
- package/dist/esm/callbacks/getQueriesData.js.map +1 -1
- package/dist/esm/callbacks/getQueryKey.js.map +1 -1
- package/dist/esm/callbacks/getQueryState.js.map +1 -1
- package/dist/esm/callbacks/invalidateQueries.js.map +1 -1
- package/dist/esm/callbacks/isFetching.js.map +1 -1
- package/dist/esm/callbacks/isMutating.js.map +1 -1
- package/dist/esm/callbacks/prefetchInfiniteQuery.js.map +1 -1
- package/dist/esm/callbacks/prefetchQuery.js.map +1 -1
- package/dist/esm/callbacks/refetchQueries.js.map +1 -1
- package/dist/esm/callbacks/removeQueries.js.map +1 -1
- package/dist/esm/callbacks/resetQueries.js.map +1 -1
- package/dist/esm/callbacks/setInfiniteQueryData.js.map +1 -1
- package/dist/esm/callbacks/setQueriesData.js.map +1 -1
- package/dist/esm/callbacks/useInfiniteQuery.js.map +1 -1
- package/dist/esm/callbacks/useIsFetching.js +1 -1
- package/dist/esm/callbacks/useIsFetching.js.map +1 -1
- package/dist/esm/callbacks/useIsMutating.js +1 -1
- package/dist/esm/callbacks/useIsMutating.js.map +1 -1
- package/dist/esm/callbacks/useMutation.js.map +1 -1
- package/dist/esm/callbacks/useMutationState.js +1 -1
- package/dist/esm/callbacks/useMutationState.js.map +1 -1
- package/dist/esm/callbacks/useQueries.js.map +1 -1
- package/dist/esm/callbacks/useQuery.js.map +1 -1
- package/dist/esm/callbacks/useSuspenseInfiniteQuery.js.map +1 -1
- package/dist/esm/callbacks/useSuspenseQueries.js.map +1 -1
- package/dist/esm/callbacks/useSuspenseQuery.js.map +1 -1
- package/dist/esm/lib/callQueryClientFetchMethod.js.map +1 -1
- package/dist/esm/lib/callQueryClientMethodWithMutationFilters.js.map +1 -1
- package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js.map +1 -1
- package/dist/esm/lib/callQueryClientMethodWithQueryKey.js.map +1 -1
- package/dist/esm/lib/useComposeUseQueryOptions.js.map +1 -1
- package/dist/esm/qraftAPIClient.js +1 -1
- package/dist/esm/qraftAPIClient.js.map +1 -1
- package/dist/types/callbacks/cancelQueries.d.ts +1 -1
- package/dist/types/callbacks/cancelQueries.d.ts.map +1 -1
- package/dist/types/callbacks/ensureInfiniteQueryData.d.ts +1 -1
- package/dist/types/callbacks/ensureInfiniteQueryData.d.ts.map +1 -1
- package/dist/types/callbacks/ensureQueryData.d.ts +1 -1
- package/dist/types/callbacks/ensureQueryData.d.ts.map +1 -1
- package/dist/types/callbacks/fetchInfiniteQuery.d.ts +1 -1
- package/dist/types/callbacks/fetchInfiniteQuery.d.ts.map +1 -1
- package/dist/types/callbacks/fetchQuery.d.ts +1 -1
- package/dist/types/callbacks/fetchQuery.d.ts.map +1 -1
- package/dist/types/callbacks/getInfiniteQueryData.d.ts +1 -1
- package/dist/types/callbacks/getInfiniteQueryData.d.ts.map +1 -1
- package/dist/types/callbacks/getInfiniteQueryKey.d.ts +1 -1
- package/dist/types/callbacks/getInfiniteQueryKey.d.ts.map +1 -1
- package/dist/types/callbacks/getInfiniteQueryState.d.ts +1 -1
- package/dist/types/callbacks/getInfiniteQueryState.d.ts.map +1 -1
- package/dist/types/callbacks/getMutationKey.d.ts +1 -1
- package/dist/types/callbacks/getMutationKey.d.ts.map +1 -1
- package/dist/types/callbacks/getQueriesData.d.ts +1 -1
- package/dist/types/callbacks/getQueriesData.d.ts.map +1 -1
- package/dist/types/callbacks/getQueryKey.d.ts +1 -1
- package/dist/types/callbacks/getQueryKey.d.ts.map +1 -1
- package/dist/types/callbacks/getQueryState.d.ts +1 -1
- package/dist/types/callbacks/getQueryState.d.ts.map +1 -1
- package/dist/types/callbacks/invalidateQueries.d.ts +1 -1
- package/dist/types/callbacks/invalidateQueries.d.ts.map +1 -1
- package/dist/types/callbacks/isFetching.d.ts +1 -1
- package/dist/types/callbacks/isFetching.d.ts.map +1 -1
- package/dist/types/callbacks/isMutating.d.ts +1 -1
- package/dist/types/callbacks/isMutating.d.ts.map +1 -1
- package/dist/types/callbacks/prefetchInfiniteQuery.d.ts +1 -1
- package/dist/types/callbacks/prefetchInfiniteQuery.d.ts.map +1 -1
- package/dist/types/callbacks/prefetchQuery.d.ts +1 -1
- package/dist/types/callbacks/prefetchQuery.d.ts.map +1 -1
- package/dist/types/callbacks/refetchQueries.d.ts +1 -1
- package/dist/types/callbacks/refetchQueries.d.ts.map +1 -1
- package/dist/types/callbacks/removeQueries.d.ts +1 -1
- package/dist/types/callbacks/removeQueries.d.ts.map +1 -1
- package/dist/types/callbacks/resetQueries.d.ts +1 -1
- package/dist/types/callbacks/resetQueries.d.ts.map +1 -1
- package/dist/types/callbacks/setInfiniteQueryData.d.ts +1 -1
- package/dist/types/callbacks/setInfiniteQueryData.d.ts.map +1 -1
- package/dist/types/callbacks/setQueriesData.d.ts +1 -1
- package/dist/types/callbacks/setQueriesData.d.ts.map +1 -1
- package/dist/types/callbacks/useInfiniteQuery.d.ts +1 -2
- package/dist/types/callbacks/useInfiniteQuery.d.ts.map +1 -1
- package/dist/types/callbacks/useIsFetching.d.ts +1 -1
- package/dist/types/callbacks/useIsFetching.d.ts.map +1 -1
- package/dist/types/callbacks/useIsMutating.d.ts +2 -3
- package/dist/types/callbacks/useIsMutating.d.ts.map +1 -1
- package/dist/types/callbacks/useMutation.d.ts +1 -2
- package/dist/types/callbacks/useMutation.d.ts.map +1 -1
- package/dist/types/callbacks/useMutationState.d.ts +2 -3
- package/dist/types/callbacks/useMutationState.d.ts.map +1 -1
- package/dist/types/callbacks/useQueries.d.ts +1 -2
- package/dist/types/callbacks/useQueries.d.ts.map +1 -1
- package/dist/types/callbacks/useQuery.d.ts +1 -2
- package/dist/types/callbacks/useQuery.d.ts.map +1 -1
- package/dist/types/callbacks/useSuspenseInfiniteQuery.d.ts +1 -2
- package/dist/types/callbacks/useSuspenseInfiniteQuery.d.ts.map +1 -1
- package/dist/types/callbacks/useSuspenseQueries.d.ts +1 -2
- package/dist/types/callbacks/useSuspenseQueries.d.ts.map +1 -1
- package/dist/types/callbacks/useSuspenseQuery.d.ts +1 -2
- package/dist/types/callbacks/useSuspenseQuery.d.ts.map +1 -1
- package/dist/types/lib/callQueryClientFetchMethod.d.ts +1 -1
- package/dist/types/lib/callQueryClientFetchMethod.d.ts.map +1 -1
- package/dist/types/lib/callQueryClientMethodWithMutationFilters.d.ts +1 -1
- package/dist/types/lib/callQueryClientMethodWithMutationFilters.d.ts.map +1 -1
- package/dist/types/lib/callQueryClientMethodWithQueryFilters.d.ts +1 -1
- package/dist/types/lib/callQueryClientMethodWithQueryFilters.d.ts.map +1 -1
- package/dist/types/lib/callQueryClientMethodWithQueryKey.d.ts +1 -1
- package/dist/types/lib/callQueryClientMethodWithQueryKey.d.ts.map +1 -1
- package/dist/types/lib/useComposeUseQueryOptions.d.ts +1 -2
- package/dist/types/lib/useComposeUseQueryOptions.d.ts.map +1 -1
- package/dist/types/qraftAPIClient.d.ts +40 -13
- package/dist/types/qraftAPIClient.d.ts.map +1 -1
- package/package.json +6 -8
- package/src/callbacks/cancelQueries.ts +1 -1
- package/src/callbacks/ensureInfiniteQueryData.ts +1 -1
- package/src/callbacks/ensureQueryData.ts +1 -1
- package/src/callbacks/fetchInfiniteQuery.ts +1 -1
- package/src/callbacks/fetchQuery.ts +1 -1
- package/src/callbacks/getInfiniteQueryData.ts +1 -1
- package/src/callbacks/getInfiniteQueryKey.ts +1 -1
- package/src/callbacks/getInfiniteQueryState.ts +1 -1
- package/src/callbacks/getMutationKey.ts +1 -1
- package/src/callbacks/getQueriesData.ts +1 -1
- package/src/callbacks/getQueryKey.ts +1 -1
- package/src/callbacks/getQueryState.ts +1 -1
- package/src/callbacks/invalidateQueries.ts +1 -1
- package/src/callbacks/isFetching.ts +1 -1
- package/src/callbacks/isMutating.ts +1 -1
- package/src/callbacks/prefetchInfiniteQuery.ts +1 -1
- package/src/callbacks/prefetchQuery.ts +1 -1
- package/src/callbacks/refetchQueries.ts +1 -1
- package/src/callbacks/removeQueries.ts +1 -1
- package/src/callbacks/resetQueries.ts +1 -1
- package/src/callbacks/setInfiniteQueryData.ts +1 -1
- package/src/callbacks/setQueriesData.ts +1 -1
- package/src/callbacks/useInfiniteQuery.ts +5 -2
- package/src/callbacks/useIsFetching.ts +2 -2
- package/src/callbacks/useIsMutating.ts +3 -4
- package/src/callbacks/useMutation.ts +1 -2
- package/src/callbacks/useMutationState.ts +3 -4
- package/src/callbacks/useQueries.ts +1 -2
- package/src/callbacks/useQuery.ts +1 -2
- package/src/callbacks/useSuspenseInfiniteQuery.ts +5 -2
- package/src/callbacks/useSuspenseQueries.ts +4 -2
- package/src/callbacks/useSuspenseQuery.ts +1 -2
- package/src/lib/callQueryClientFetchMethod.ts +1 -1
- package/src/lib/callQueryClientMethodWithMutationFilters.ts +1 -1
- package/src/lib/callQueryClientMethodWithQueryFilters.ts +1 -1
- package/src/lib/callQueryClientMethodWithQueryKey.ts +1 -1
- package/src/lib/useComposeUseQueryOptions.ts +1 -2
- package/src/qraftAPIClient.ts +101 -36
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceOperationFetchQuery } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { DefaultError } from '@tanstack/query
|
|
2
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
3
3
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
4
4
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceOperationFetchInfiniteQuery } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { DefaultError } from '@tanstack/query
|
|
2
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
3
3
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
4
4
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceOperationFetchQuery } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { DefaultError } from '@tanstack/query
|
|
2
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
3
3
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
4
4
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js';
|
|
5
5
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationGetInfiniteQueryData,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { InfiniteData } from '@tanstack/query
|
|
5
|
+
import type { InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationUseInfiniteQuery,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIBasicClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { composeInfiniteQueryKey } from '../lib/composeInfiniteQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationGetQueryState,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationUseMutation,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIBasicClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { composeMutationKey } from '../lib/composeMutationKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationGetQueriesData,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationUseQuery,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIBasicClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { composeQueryKey } from '../lib/composeQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationGetQueryState,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationInvalidateQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationIsFetchingQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationIsMutatingQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithMutationFilters } from '../lib/callQueryClientMethodWithMutationFilters.js';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceOperationFetchInfiniteQuery } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { DefaultError } from '@tanstack/query
|
|
2
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
3
3
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
4
4
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ServiceOperationFetchQuery } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { DefaultError } from '@tanstack/query
|
|
2
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
3
3
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
4
4
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js';
|
|
5
5
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationRefetchQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationRemoveQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationResetQueries,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationSetInfiniteQueryData,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { InfiniteData } from '@tanstack/query
|
|
5
|
+
import type { InfiniteData } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js';
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import type {
|
|
|
2
2
|
OperationSchema,
|
|
3
3
|
ServiceOperationSetQueriesData,
|
|
4
4
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
5
|
-
import type { DefaultError } from '@tanstack/query
|
|
5
|
+
import type { DefaultError } from '@tanstack/react-query';
|
|
6
6
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
7
|
import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js';
|
|
8
8
|
|
|
@@ -4,8 +4,11 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseInfiniteQuery,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type {
|
|
8
|
-
|
|
7
|
+
import type {
|
|
8
|
+
DefaultError,
|
|
9
|
+
InfiniteData,
|
|
10
|
+
UseInfiniteQueryResult,
|
|
11
|
+
} from '@tanstack/react-query';
|
|
9
12
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
13
|
import { useInfiniteQuery as useInfiniteQueryBase } from '@tanstack/react-query';
|
|
11
14
|
import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';
|
|
@@ -9,7 +9,7 @@ import { useIsFetching as useIsFetchingTanstack } from '@tanstack/react-query';
|
|
|
9
9
|
import { composeQueryFilters } from '../lib/composeQueryFilters.js';
|
|
10
10
|
|
|
11
11
|
export const useIsFetching: <TVariables = unknown>(
|
|
12
|
-
qraftOptions: CreateAPIQueryClientOptions,
|
|
12
|
+
qraftOptions: CreateAPIQueryClientOptions | undefined,
|
|
13
13
|
schema: OperationSchema,
|
|
14
14
|
args: Parameters<
|
|
15
15
|
ServiceOperationUseIsFetchingQueries<
|
|
@@ -24,6 +24,6 @@ export const useIsFetching: <TVariables = unknown>(
|
|
|
24
24
|
|
|
25
25
|
return useIsFetchingTanstack(
|
|
26
26
|
composeQueryFilters(schema, filters as never) as never,
|
|
27
|
-
qraftOptions
|
|
27
|
+
qraftOptions?.queryClient
|
|
28
28
|
) as never;
|
|
29
29
|
};
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseIsMutating,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type { DefaultError } from '@tanstack/query
|
|
8
|
-
import type { UseMutationResult } from '@tanstack/react-query';
|
|
7
|
+
import type { DefaultError, UseMutationResult } from '@tanstack/react-query';
|
|
9
8
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
9
|
import { useIsMutating as useIsMutatingStateTanstack } from '@tanstack/react-query';
|
|
11
10
|
import { composeMutationFilters } from '../lib/composeMutationFilters.js';
|
|
@@ -16,7 +15,7 @@ export const useIsMutating: <
|
|
|
16
15
|
TVariables = unknown,
|
|
17
16
|
TContext = unknown,
|
|
18
17
|
>(
|
|
19
|
-
qraftOptions: CreateAPIQueryClientOptions,
|
|
18
|
+
qraftOptions: CreateAPIQueryClientOptions | undefined,
|
|
20
19
|
schema: OperationSchema,
|
|
21
20
|
args: Parameters<
|
|
22
21
|
ServiceOperationUseIsMutating<
|
|
@@ -36,6 +35,6 @@ export const useIsMutating: <
|
|
|
36
35
|
|
|
37
36
|
return useIsMutatingStateTanstack(
|
|
38
37
|
composeMutationFilters(schema, filters) as never,
|
|
39
|
-
qraftOptions
|
|
38
|
+
qraftOptions?.queryClient
|
|
40
39
|
) as never;
|
|
41
40
|
};
|
|
@@ -5,8 +5,7 @@ import type {
|
|
|
5
5
|
ServiceOperationMutationKey,
|
|
6
6
|
ServiceOperationUseMutation,
|
|
7
7
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
8
|
-
import type { DefaultError } from '@tanstack/query
|
|
9
|
-
import type { UseMutationResult } from '@tanstack/react-query';
|
|
8
|
+
import type { DefaultError, UseMutationResult } from '@tanstack/react-query';
|
|
10
9
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
11
10
|
import { useMutation as useMutationBase } from '@tanstack/react-query';
|
|
12
11
|
import { composeMutationKey } from '../lib/composeMutationKey.js';
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseMutationState,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type { DefaultError } from '@tanstack/query
|
|
8
|
-
import type { UseMutationResult } from '@tanstack/react-query';
|
|
7
|
+
import type { DefaultError, UseMutationResult } from '@tanstack/react-query';
|
|
9
8
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
9
|
import { useMutationState as useMutationStateTanstack } from '@tanstack/react-query';
|
|
11
10
|
import { composeMutationFilters } from '../lib/composeMutationFilters.js';
|
|
@@ -16,7 +15,7 @@ export const useMutationState: <
|
|
|
16
15
|
TVariables = unknown,
|
|
17
16
|
TContext = unknown,
|
|
18
17
|
>(
|
|
19
|
-
qraftOptions: CreateAPIQueryClientOptions,
|
|
18
|
+
qraftOptions: CreateAPIQueryClientOptions | undefined,
|
|
20
19
|
schema: OperationSchema,
|
|
21
20
|
args: Parameters<
|
|
22
21
|
ServiceOperationUseMutationState<
|
|
@@ -39,6 +38,6 @@ export const useMutationState: <
|
|
|
39
38
|
...options,
|
|
40
39
|
filters: composeMutationFilters(schema, options?.filters),
|
|
41
40
|
} as never,
|
|
42
|
-
qraftOptions
|
|
41
|
+
qraftOptions?.queryClient
|
|
43
42
|
) as never;
|
|
44
43
|
};
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseQueries,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type { DefaultError } from '@tanstack/query
|
|
8
|
-
import type { QueriesResults } from '@tanstack/react-query';
|
|
7
|
+
import type { DefaultError, QueriesResults } from '@tanstack/react-query';
|
|
9
8
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
9
|
import { useQueries as useQueriesTanstack } from '@tanstack/react-query';
|
|
11
10
|
import { composeQueryKey } from '../lib/composeQueryKey.js';
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseQuery,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type { DefaultError } from '@tanstack/query
|
|
8
|
-
import type { UseQueryResult } from '@tanstack/react-query';
|
|
7
|
+
import type { DefaultError, UseQueryResult } from '@tanstack/react-query';
|
|
9
8
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
9
|
import { useQuery as useQueryTanstack } from '@tanstack/react-query';
|
|
11
10
|
import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';
|
|
@@ -4,8 +4,11 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseSuspenseInfiniteQuery,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type {
|
|
8
|
-
|
|
7
|
+
import type {
|
|
8
|
+
DefaultError,
|
|
9
|
+
InfiniteData,
|
|
10
|
+
UseSuspenseInfiniteQueryResult,
|
|
11
|
+
} from '@tanstack/react-query';
|
|
9
12
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
13
|
import { useSuspenseInfiniteQuery as useSuspenseInfiniteQueryTanstack } from '@tanstack/react-query';
|
|
11
14
|
import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';
|
|
@@ -4,8 +4,10 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseSuspenseQueries,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type {
|
|
8
|
-
|
|
7
|
+
import type {
|
|
8
|
+
DefaultError,
|
|
9
|
+
SuspenseQueriesResults,
|
|
10
|
+
} from '@tanstack/react-query';
|
|
9
11
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
12
|
import { useSuspenseQueries as useSuspenseQueriesTanstack } from '@tanstack/react-query';
|
|
11
13
|
import { composeQueryKey } from '../lib/composeQueryKey.js';
|
|
@@ -4,8 +4,7 @@ import type {
|
|
|
4
4
|
OperationSchema,
|
|
5
5
|
ServiceOperationUseSuspenseQuery,
|
|
6
6
|
} from '@openapi-qraft/tanstack-query-react-types';
|
|
7
|
-
import type { DefaultError } from '@tanstack/query
|
|
8
|
-
import type { UseQueryResult } from '@tanstack/react-query';
|
|
7
|
+
import type { DefaultError, UseQueryResult } from '@tanstack/react-query';
|
|
9
8
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
10
9
|
import { useSuspenseQuery as useSuspenseQueryTanstack } from '@tanstack/react-query';
|
|
11
10
|
import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/query
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
3
3
|
import type { OperationSchema, RequestFn } from './requestFn.js';
|
|
4
4
|
import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/query
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
3
3
|
import type { OperationSchema } from './requestFn.js';
|
|
4
4
|
import { composeMutationFilters } from './composeMutationFilters.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/query
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
3
3
|
import type { OperationSchema } from './requestFn.js';
|
|
4
4
|
import { composeQueryFilters } from './composeQueryFilters.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QueryClient } from '@tanstack/query
|
|
1
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
3
3
|
import type { OperationSchema } from './requestFn.js';
|
|
4
4
|
import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import type { ServiceOperationQueryKey } from '@openapi-qraft/tanstack-query-react-types';
|
|
4
|
-
import type { QueryClient } from '@tanstack/query
|
|
5
|
-
import type { UseQueryOptions } from '@tanstack/react-query';
|
|
4
|
+
import type { QueryClient, UseQueryOptions } from '@tanstack/react-query';
|
|
6
5
|
import type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';
|
|
7
6
|
import type { OperationSchema } from './requestFn.js';
|
|
8
7
|
import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js';
|
package/src/qraftAPIClient.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { QraftServiceOperationsToken } from '@openapi-qraft/tanstack-query-react-types';
|
|
2
|
-
import type { QueryClient } from '@tanstack/query
|
|
2
|
+
import type { QueryClient } from '@tanstack/react-query';
|
|
3
3
|
import type * as callbacks from './callbacks/index.js';
|
|
4
4
|
import type * as operationInvokeModule from './callbacks/operationInvokeFn.js';
|
|
5
5
|
import type {
|
|
@@ -115,8 +115,23 @@ export function qraftAPIClient<
|
|
|
115
115
|
): APIBasicQueryClientServices<Services, Callbacks>;
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
|
-
* Creates a basic API Client which contains
|
|
119
|
-
*
|
|
118
|
+
* Creates a basic API Client which contains all hooks and methods
|
|
119
|
+
* that don't require an explicitly provided QueryClient.
|
|
120
|
+
* Hooks like `useQuery` and `useMutation` will automatically retrieve
|
|
121
|
+
* the QueryClient from the `<QueryClientProvider />` context.
|
|
122
|
+
*
|
|
123
|
+
* @example Fetching data with QueryClient from context
|
|
124
|
+
* ```ts
|
|
125
|
+
* const api = qraftAPIClient(services, callbacks, {
|
|
126
|
+
* requestFn: requestFn,
|
|
127
|
+
* baseUrl: 'https://api.example.com',
|
|
128
|
+
* });
|
|
129
|
+
*
|
|
130
|
+
* // QueryClient will be retrieved from React context
|
|
131
|
+
* api.service.operation.useQuery({
|
|
132
|
+
* parameters: { path: { id: 1 } },
|
|
133
|
+
* });
|
|
134
|
+
* ```
|
|
120
135
|
*
|
|
121
136
|
* @example Fetching data without QueryClient
|
|
122
137
|
* ```ts
|
|
@@ -140,8 +155,17 @@ export function qraftAPIClient<
|
|
|
140
155
|
): APIBasicClientServices<Services, Callbacks>;
|
|
141
156
|
|
|
142
157
|
/**
|
|
143
|
-
* Creates a utility API Client which contains
|
|
144
|
-
* such as `getQueryKey`, `getInfiniteQueryKey` and
|
|
158
|
+
* Creates a utility API Client which contains utility operations
|
|
159
|
+
* such as `getQueryKey`, `getInfiniteQueryKey`, `getMutationKey` and state hooks
|
|
160
|
+
* like `useIsFetching` and `useMutationData`.
|
|
161
|
+
*
|
|
162
|
+
* @example Using state hooks
|
|
163
|
+
* ```ts
|
|
164
|
+
* const api = qraftAPIClient(services, callbacks);
|
|
165
|
+
*
|
|
166
|
+
* // Check if any query is currently fetching
|
|
167
|
+
* const isFetching = api.service.operation.useIsFetching();
|
|
168
|
+
* ```
|
|
145
169
|
*
|
|
146
170
|
* @example Getting query keys with utility client
|
|
147
171
|
* ```ts
|
|
@@ -241,7 +265,17 @@ export function qraftAPIClient<
|
|
|
241
265
|
callbackName !== 'operationInvokeFn' &&
|
|
242
266
|
callbackName !== 'getQueryKey' &&
|
|
243
267
|
callbackName !== 'getMutationKey' &&
|
|
244
|
-
callbackName !== 'getInfiniteQueryKey'
|
|
268
|
+
callbackName !== 'getInfiniteQueryKey' &&
|
|
269
|
+
callbackName !== 'useInfiniteQuery' &&
|
|
270
|
+
callbackName !== 'useQueries' &&
|
|
271
|
+
callbackName !== 'useQuery' &&
|
|
272
|
+
callbackName !== 'useSuspenseInfiniteQuery' &&
|
|
273
|
+
callbackName !== 'useSuspenseQueries' &&
|
|
274
|
+
callbackName !== 'useSuspenseQuery' &&
|
|
275
|
+
callbackName !== 'useIsFetching' &&
|
|
276
|
+
callbackName !== 'useMutation' &&
|
|
277
|
+
callbackName !== 'useIsMutating' &&
|
|
278
|
+
callbackName !== 'useMutationState'
|
|
245
279
|
)
|
|
246
280
|
if (!options || !('queryClient' in options && options.queryClient))
|
|
247
281
|
throw new Error(
|
|
@@ -331,7 +365,7 @@ type OperationDeclaration = {
|
|
|
331
365
|
Record<
|
|
332
366
|
| QueryOperationCallbacks
|
|
333
367
|
| QueryOperationStateCallbacks
|
|
334
|
-
|
|
|
368
|
+
| MutationOperationHookCallbacks
|
|
335
369
|
| MutationOperationStateCallbacks
|
|
336
370
|
| UtilityOperationCallbacks,
|
|
337
371
|
any
|
|
@@ -356,15 +390,8 @@ export type UnionServiceOperationsDeclaration<Services> =
|
|
|
356
390
|
| OperationsDeclaration<Services>
|
|
357
391
|
| OperationDeclaration;
|
|
358
392
|
|
|
359
|
-
type
|
|
393
|
+
type QueryOperationHookCallbacks = Extract<
|
|
360
394
|
keyof ServiceMethods,
|
|
361
|
-
| 'fetchInfiniteQuery'
|
|
362
|
-
| 'fetchQuery'
|
|
363
|
-
| 'prefetchInfiniteQuery'
|
|
364
|
-
| 'prefetchQuery'
|
|
365
|
-
| 'refetchQueries'
|
|
366
|
-
| 'ensureQueryData'
|
|
367
|
-
| 'ensureInfiniteQueryData'
|
|
368
395
|
| 'useInfiniteQuery'
|
|
369
396
|
| 'useQueries'
|
|
370
397
|
| 'useQuery'
|
|
@@ -373,31 +400,57 @@ type QueryOperationCallbacks = Extract<
|
|
|
373
400
|
| 'useSuspenseQuery'
|
|
374
401
|
>;
|
|
375
402
|
|
|
376
|
-
type
|
|
403
|
+
type QueryOperationCallbacks =
|
|
404
|
+
| Extract<
|
|
405
|
+
keyof ServiceMethods,
|
|
406
|
+
| 'fetchInfiniteQuery'
|
|
407
|
+
| 'fetchQuery'
|
|
408
|
+
| 'prefetchInfiniteQuery'
|
|
409
|
+
| 'prefetchQuery'
|
|
410
|
+
| 'refetchQueries'
|
|
411
|
+
| 'ensureQueryData'
|
|
412
|
+
| 'ensureInfiniteQueryData'
|
|
413
|
+
>
|
|
414
|
+
| QueryOperationHookCallbacks;
|
|
415
|
+
|
|
416
|
+
type QueryOperationStateHookCallbacks = Extract<
|
|
377
417
|
keyof ServiceMethods,
|
|
378
|
-
|
|
379
|
-
| 'getInfiniteQueryData'
|
|
380
|
-
| 'getInfiniteQueryState'
|
|
381
|
-
| 'getQueriesData'
|
|
382
|
-
| 'getQueryData'
|
|
383
|
-
| 'getQueryState'
|
|
384
|
-
| 'invalidateQueries'
|
|
385
|
-
| 'isFetching'
|
|
386
|
-
| 'removeQueries'
|
|
387
|
-
| 'resetQueries'
|
|
388
|
-
| 'setInfiniteQueryData'
|
|
389
|
-
| 'setQueriesData'
|
|
390
|
-
| 'setQueryData'
|
|
391
|
-
| 'useIsFetching'
|
|
418
|
+
'useIsFetching'
|
|
392
419
|
>;
|
|
393
420
|
|
|
394
|
-
type
|
|
421
|
+
type QueryOperationStateCallbacks =
|
|
422
|
+
| Extract<
|
|
423
|
+
keyof ServiceMethods,
|
|
424
|
+
| 'cancelQueries'
|
|
425
|
+
| 'getInfiniteQueryData'
|
|
426
|
+
| 'getInfiniteQueryState'
|
|
427
|
+
| 'getQueriesData'
|
|
428
|
+
| 'getQueryData'
|
|
429
|
+
| 'getQueryState'
|
|
430
|
+
| 'invalidateQueries'
|
|
431
|
+
| 'isFetching'
|
|
432
|
+
| 'removeQueries'
|
|
433
|
+
| 'resetQueries'
|
|
434
|
+
| 'setInfiniteQueryData'
|
|
435
|
+
| 'setQueriesData'
|
|
436
|
+
| 'setQueryData'
|
|
437
|
+
>
|
|
438
|
+
| QueryOperationStateHookCallbacks;
|
|
395
439
|
|
|
396
|
-
type
|
|
440
|
+
type MutationOperationHookCallbacks = Extract<
|
|
397
441
|
keyof ServiceMethods,
|
|
398
|
-
'
|
|
442
|
+
'useMutation'
|
|
399
443
|
>;
|
|
400
444
|
|
|
445
|
+
type MutationOperationStateHookCallbacks = Extract<
|
|
446
|
+
keyof ServiceMethods,
|
|
447
|
+
'useIsMutating' | 'useMutationState'
|
|
448
|
+
>;
|
|
449
|
+
|
|
450
|
+
type MutationOperationStateCallbacks =
|
|
451
|
+
| Extract<keyof ServiceMethods, 'isMutating'>
|
|
452
|
+
| MutationOperationStateHookCallbacks;
|
|
453
|
+
|
|
401
454
|
type InvokeOperationCallback = Extract<
|
|
402
455
|
keyof typeof operationInvokeModule,
|
|
403
456
|
'operationInvokeFn'
|
|
@@ -405,13 +458,17 @@ type InvokeOperationCallback = Extract<
|
|
|
405
458
|
|
|
406
459
|
type UtilityOperationCallbacks = Extract<
|
|
407
460
|
keyof ServiceMethods,
|
|
408
|
-
|
|
461
|
+
| 'getQueryKey'
|
|
462
|
+
| 'getInfiniteQueryKey'
|
|
463
|
+
| 'getMutationKey'
|
|
464
|
+
| QueryOperationStateHookCallbacks
|
|
465
|
+
| MutationOperationStateHookCallbacks
|
|
409
466
|
>;
|
|
410
467
|
|
|
411
468
|
type OperationCallbackList =
|
|
412
469
|
| QueryOperationCallbacks
|
|
413
470
|
| QueryOperationStateCallbacks
|
|
414
|
-
|
|
|
471
|
+
| MutationOperationHookCallbacks
|
|
415
472
|
| MutationOperationStateCallbacks
|
|
416
473
|
| InvokeOperationCallback
|
|
417
474
|
| UtilityOperationCallbacks;
|
|
@@ -458,7 +515,15 @@ export type APIBasicClientServices<
|
|
|
458
515
|
Callbacks extends PartialServiceMethods,
|
|
459
516
|
> = ServicesFilteredByCallbacks<
|
|
460
517
|
Services,
|
|
461
|
-
Extract<
|
|
518
|
+
Extract<
|
|
519
|
+
keyof Callbacks,
|
|
520
|
+
| InvokeOperationCallback
|
|
521
|
+
| UtilityOperationCallbacks
|
|
522
|
+
| QueryOperationHookCallbacks
|
|
523
|
+
| QueryOperationStateHookCallbacks
|
|
524
|
+
| MutationOperationStateHookCallbacks
|
|
525
|
+
| MutationOperationHookCallbacks
|
|
526
|
+
>
|
|
462
527
|
>;
|
|
463
528
|
|
|
464
529
|
export type APIUtilityClientServices<
|