Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: Migrate to use custom type for ReactQuery queries and mutations (#40073)

Ivan Vasilov8b657165b580
diff --git a/apps/studio/components/interfaces/Organization/CloudMarketplace/cloud-marketplace-query.ts b/apps/studio/components/interfaces/Organization/CloudMarketplace/cloud-marketplace-query.ts
index 359ee20aea5..4f8ad4601a0 100644
--- a/apps/studio/components/interfaces/Organization/CloudMarketplace/cloud-marketplace-query.ts
+++ b/apps/studio/components/interfaces/Organization/CloudMarketplace/cloud-marketplace-query.ts
@@ -1,6 +1,6 @@
+import { useQuery } from '@tanstack/react-query'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { get, handleError } from '../../../../data/fetchers'
-import type { ResponseError } from '../../../../types'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
import { useProfile } from '../../../../lib/profile'
import { cloudMarketplaceKeys } from './keys'
@@ -35,7 +35,7 @@ export const useCloudMarketplaceOnboardingInfoQuery = <TData = CloudMarketplaceO
{
enabled = true,
...options
- }: UseQueryOptions<
+ }: UseCustomQueryOptions<
CloudMarketplaceOnboardingInfo,
CloudMarketplaceOnboardingInfoError,
TData
diff --git a/apps/studio/components/interfaces/Storage/StorageExplorer/useFetchFileUrlQuery.tsx b/apps/studio/components/interfaces/Storage/StorageExplorer/useFetchFileUrlQuery.tsx
index a3d1905d1f2..b20aa1d2d90 100644
--- a/apps/studio/components/interfaces/Storage/StorageExplorer/useFetchFileUrlQuery.tsx
+++ b/apps/studio/components/interfaces/Storage/StorageExplorer/useFetchFileUrlQuery.tsx
@@ -1,9 +1,9 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { getPublicUrlForBucketObject } from 'data/storage/bucket-object-get-public-url-mutation'
import { signBucketObject } from 'data/storage/bucket-object-sign-mutation'
import { Bucket } from 'data/storage/buckets-query'
import { useStorageExplorerStateSnapshot } from 'state/storage-explorer'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { StorageItem } from '../Storage.types'
const DEFAULT_EXPIRY = 7 * 24 * 60 * 60 // in seconds, default to 1 week
@@ -41,7 +41,7 @@ type UseFileUrlQueryVariables = {
export const useFetchFileUrlQuery = (
{ file, projectRef, bucket }: UseFileUrlQueryVariables,
- { ...options }: UseQueryOptions<string, ResponseError> = {}
+ { ...options }: UseCustomQueryOptions<string, ResponseError> = {}
) => {
const { getPathAlongOpenedFolders } = useStorageExplorerStateSnapshot()
const pathToFile = getPathAlongOpenedFolders(false)
diff --git a/apps/studio/data/__templates/resource-query.ts b/apps/studio/data/__templates/resource-query.ts
index b79eec258df..7bb872e996b 100644
--- a/apps/studio/data/__templates/resource-query.ts
+++ b/apps/studio/data/__templates/resource-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { useCallback } from 'react'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { resourceKeys } from './keys'
export type ResourceVariables = {
@@ -31,7 +31,7 @@ export type ResourceError = ResponseError
export const useResourceQuery = <TData = ResourceData>(
{ projectRef, id }: ResourceVariables,
- { enabled = true, ...options }: UseQueryOptions<ResourceData, ResourceError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ResourceData, ResourceError, TData> = {}
) =>
useQuery<ResourceData, ResourceError, TData>({
queryKey: resourceKeys.resource(projectRef, id),
diff --git a/apps/studio/data/__templates/resource-update-mutation.ts b/apps/studio/data/__templates/resource-update-mutation.ts
index e17c5abb1c0..478d6785ae7 100644
--- a/apps/studio/data/__templates/resource-update-mutation.ts
+++ b/apps/studio/data/__templates/resource-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { resourceKeys } from './keys'
export type ResourceUpdateVariables = {
@@ -29,7 +29,7 @@ export const useResourceUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ResourceUpdateData, ResponseError, ResourceUpdateVariables>,
+ UseCustomMutationOptions<ResourceUpdateData, ResponseError, ResourceUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/__templates/resources-query.ts b/apps/studio/data/__templates/resources-query.ts
index d15450497a3..095d920f7d4 100644
--- a/apps/studio/data/__templates/resources-query.ts
+++ b/apps/studio/data/__templates/resources-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { useCallback } from 'react'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { resourceKeys } from './keys'
export type ResourcesVariables = {
@@ -26,7 +26,7 @@ export type ResourcesError = ResponseError
export const useResourcesQuery = <TData = ResourcesData>(
{ projectRef }: ResourcesVariables,
- { enabled = true, ...options }: UseQueryOptions<ResourcesData, ResourcesError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ResourcesData, ResourcesError, TData> = {}
) =>
useQuery<ResourcesData, ResourcesError, TData>({
queryKey: resourceKeys.list(projectRef),
diff --git a/apps/studio/data/access-tokens/access-tokens-create-mutation.ts b/apps/studio/data/access-tokens/access-tokens-create-mutation.ts
index 928cc983f59..e932b878778 100644
--- a/apps/studio/data/access-tokens/access-tokens-create-mutation.ts
+++ b/apps/studio/data/access-tokens/access-tokens-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { accessTokenKeys } from './keys'
export type AccessTokenCreateVariables = components['schemas']['CreateAccessTokenBody']
@@ -27,7 +27,7 @@ export const useAccessTokenCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AccessTokenCreateData, ResponseError, AccessTokenCreateVariables>,
+ UseCustomMutationOptions<AccessTokenCreateData, ResponseError, AccessTokenCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts b/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts
index dcf677b9cf2..2b5dd614d48 100644
--- a/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts
+++ b/apps/studio/data/access-tokens/access-tokens-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { accessTokenKeys } from './keys'
export type AccessTokenDeleteVariables = {
@@ -25,7 +25,7 @@ export const useAccessTokenDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AccessTokenDeleteData, ResponseError, AccessTokenDeleteVariables>,
+ UseCustomMutationOptions<AccessTokenDeleteData, ResponseError, AccessTokenDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/access-tokens/access-tokens-query.ts b/apps/studio/data/access-tokens/access-tokens-query.ts
index 53d5f97c3b6..7713cc6ee70 100644
--- a/apps/studio/data/access-tokens/access-tokens-query.ts
+++ b/apps/studio/data/access-tokens/access-tokens-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { accessTokenKeys } from './keys'
export async function getAccessTokens(signal?: AbortSignal) {
@@ -20,7 +20,7 @@ export type AccessToken = AccessTokensData[number]
export const useAccessTokensQuery = <TData = AccessTokensData>({
enabled = true,
...options
-}: UseQueryOptions<AccessTokensData, AccessTokensError, TData> = {}) =>
+}: UseCustomQueryOptions<AccessTokensData, AccessTokensError, TData> = {}) =>
useQuery<AccessTokensData, AccessTokensError, TData>({
queryKey: accessTokenKeys.list(),
queryFn: ({ signal }) => getAccessTokens(signal),
diff --git a/apps/studio/data/actions/action-detail-query.ts b/apps/studio/data/actions/action-detail-query.ts
index b2957ef8e5f..1b09c0c40dd 100644
--- a/apps/studio/data/actions/action-detail-query.ts
+++ b/apps/studio/data/actions/action-detail-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { operations } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { actionKeys } from './keys'
export type ActionRunVariables = operations['v1-get-action-run']['parameters']['path']
@@ -21,7 +21,7 @@ export type ActionRunError = ResponseError
export const useActionRunQuery = <TData = ActionRunData>(
{ ref, run_id }: ActionRunVariables,
- { enabled = true, ...options }: UseQueryOptions<ActionRunData, ActionRunError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ActionRunData, ActionRunError, TData> = {}
) =>
useQuery<ActionRunData, ActionRunError, TData>({
queryKey: actionKeys.detail(ref, run_id),
diff --git a/apps/studio/data/actions/action-logs-query.ts b/apps/studio/data/actions/action-logs-query.ts
index 27270834def..20aaecadfa4 100644
--- a/apps/studio/data/actions/action-logs-query.ts
+++ b/apps/studio/data/actions/action-logs-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { actionKeys } from './keys'
export type ActionLogsVariables = operations['v1-get-action-run-logs']['parameters']['path']
@@ -27,7 +27,10 @@ export type WorkflowRunLogsError = ResponseError
export const useActionRunLogsQuery = <TData = ActionLogsData>(
{ ref, run_id }: ActionLogsVariables,
- { enabled = true, ...options }: UseQueryOptions<ActionLogsData, WorkflowRunLogsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ActionLogsData, WorkflowRunLogsError, TData> = {}
) =>
useQuery<ActionLogsData, WorkflowRunLogsError, TData>({
queryKey: actionKeys.detail(ref, run_id),
diff --git a/apps/studio/data/actions/action-runs-query.ts b/apps/studio/data/actions/action-runs-query.ts
index 64bf56e2a2e..616b1c1cd3f 100644
--- a/apps/studio/data/actions/action-runs-query.ts
+++ b/apps/studio/data/actions/action-runs-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, type UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { operations } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { actionKeys } from './keys'
export type ActionsVariables = operations['v1-list-action-runs']['parameters']['path']
@@ -25,7 +25,7 @@ export type ActionStatus = ActionRunStep['status']
export const useActionsQuery = <TData = ActionsData>(
{ ref }: ActionsVariables,
- { enabled = true, ...options }: UseQueryOptions<ActionsData, ActionsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ActionsData, ActionsError, TData> = {}
) =>
useQuery<ActionsData, ActionsError, TData>({
queryKey: actionKeys.list(ref),
diff --git a/apps/studio/data/ai/check-api-key-query.ts b/apps/studio/data/ai/check-api-key-query.ts
index f0c9c61b58d..53a8816961a 100644
--- a/apps/studio/data/ai/check-api-key-query.ts
+++ b/apps/studio/data/ai/check-api-key-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { constructHeaders, fetchHandler } from 'data/fetchers'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
-import { ResponseError } from 'types'
+import { ResponseError, UseCustomQueryOptions } from 'types'
import { aiKeys } from './keys'
// check to see if the OPENAI_API_KEY env var is set in self-hosted
@@ -33,7 +33,7 @@ export type ResourceError = { errorEventId: string; message: string }
export const useCheckOpenAIKeyQuery = <TData = ResourceData>({
enabled = true,
...options
-}: UseQueryOptions<ResourceData, ResourceError, TData> = {}) =>
+}: UseCustomQueryOptions<ResourceData, ResourceError, TData> = {}) =>
useQuery<ResourceData, ResourceError, TData>({
queryKey: aiKeys.apiKey(),
queryFn: ({ signal }) => checkOpenAIKey(signal),
diff --git a/apps/studio/data/ai/rate-message-mutation.ts b/apps/studio/data/ai/rate-message-mutation.ts
index e0b0abbf174..5f8b080e46b 100644
--- a/apps/studio/data/ai/rate-message-mutation.ts
+++ b/apps/studio/data/ai/rate-message-mutation.ts
@@ -1,10 +1,10 @@
import { UIMessage } from '@ai-sdk/react'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import type { RateMessageResponse } from 'components/ui/AIAssistantPanel/Message.utils'
import { constructHeaders, fetchHandler } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import { ResponseError } from 'types'
+import { ResponseError, UseCustomMutationOptions } from 'types'
export type RateMessageVariables = {
rating: 'positive' | 'negative'
@@ -52,7 +52,7 @@ export const useRateMessageMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<RateMessageData, ResponseError, RateMessageVariables>,
+ UseCustomMutationOptions<RateMessageData, ResponseError, RateMessageVariables>,
'mutationFn'
> = {}) => {
return useMutation<RateMessageData, ResponseError, RateMessageVariables>({
diff --git a/apps/studio/data/ai/sql-cron-mutation.ts b/apps/studio/data/ai/sql-cron-mutation.ts
index c9c636b0568..ffa453f3d7d 100644
--- a/apps/studio/data/ai/sql-cron-mutation.ts
+++ b/apps/studio/data/ai/sql-cron-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { constructHeaders, fetchHandler } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import { ResponseError } from 'types'
+import { ResponseError, UseCustomMutationOptions } from 'types'
export type SqlCronGenerateResponse = string
@@ -41,7 +41,7 @@ export const useSqlCronGenerateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SqlCronGenerateData, ResponseError, SqlCronGenerateVariables>,
+ UseCustomMutationOptions<SqlCronGenerateData, ResponseError, SqlCronGenerateVariables>,
'mutationFn'
> = {}) => {
return useMutation<SqlCronGenerateData, ResponseError, SqlCronGenerateVariables>({
diff --git a/apps/studio/data/ai/sql-title-mutation.ts b/apps/studio/data/ai/sql-title-mutation.ts
index a5bf4c95044..e810d914851 100644
--- a/apps/studio/data/ai/sql-title-mutation.ts
+++ b/apps/studio/data/ai/sql-title-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { constructHeaders, fetchHandler } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import { ResponseError } from 'types'
+import { ResponseError, UseCustomMutationOptions } from 'types'
export type SqlTitleGenerateResponse = {
title: string
@@ -45,7 +45,7 @@ export const useSqlTitleGenerateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SqlTitleGenerateData, ResponseError, SqlTitleGenerateVariables>,
+ UseCustomMutationOptions<SqlTitleGenerateData, ResponseError, SqlTitleGenerateVariables>,
'mutationFn'
> = {}) => {
return useMutation<SqlTitleGenerateData, ResponseError, SqlTitleGenerateVariables>({
diff --git a/apps/studio/data/analytics/functions-combined-stats-query.ts b/apps/studio/data/analytics/functions-combined-stats-query.ts
index c9fa6f38103..d22181c45a2 100644
--- a/apps/studio/data/analytics/functions-combined-stats-query.ts
+++ b/apps/studio/data/analytics/functions-combined-stats-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type FunctionsCombinedStatsVariables = {
projectRef?: string
@@ -54,7 +55,7 @@ export const useFunctionsCombinedStatsQuery = <TData = FunctionsCombinedStatsDat
{
enabled = true,
...options
- }: UseQueryOptions<FunctionsCombinedStatsData, FunctionsCombinedStatsError, TData> = {}
+ }: UseCustomQueryOptions<FunctionsCombinedStatsData, FunctionsCombinedStatsError, TData> = {}
) =>
useQuery<FunctionsCombinedStatsData, FunctionsCombinedStatsError, TData>({
queryKey: analyticsKeys.functionsCombinedStats(projectRef, { functionId, interval }),
diff --git a/apps/studio/data/analytics/functions-req-stats-query.ts b/apps/studio/data/analytics/functions-req-stats-query.ts
index 0b974c4b12d..90ec7709313 100644
--- a/apps/studio/data/analytics/functions-req-stats-query.ts
+++ b/apps/studio/data/analytics/functions-req-stats-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type FunctionsReqStatsVariables = {
projectRef?: string
@@ -54,7 +55,7 @@ export const useFunctionsReqStatsQuery = <TData = FunctionsReqStatsData>(
{
enabled = true,
...options
- }: UseQueryOptions<FunctionsReqStatsData, FunctionsReqStatsError, TData> = {}
+ }: UseCustomQueryOptions<FunctionsReqStatsData, FunctionsReqStatsError, TData> = {}
) =>
useQuery<FunctionsReqStatsData, FunctionsReqStatsError, TData>({
queryKey: analyticsKeys.functionsReqStats(projectRef, { functionId, interval }),
diff --git a/apps/studio/data/analytics/functions-resource-usage-query.ts b/apps/studio/data/analytics/functions-resource-usage-query.ts
index 45d8d1a4f81..dd49f11567b 100644
--- a/apps/studio/data/analytics/functions-resource-usage-query.ts
+++ b/apps/studio/data/analytics/functions-resource-usage-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type FunctionsResourceUsageVariables = {
projectRef?: string
@@ -54,7 +55,7 @@ export const useFunctionsResourceUsageQuery = <TData = FunctionsResourceUsageDat
{
enabled = true,
...options
- }: UseQueryOptions<FunctionsResourceUsageData, FunctionsResourceUsageError, TData> = {}
+ }: UseCustomQueryOptions<FunctionsResourceUsageData, FunctionsResourceUsageError, TData> = {}
) =>
useQuery<FunctionsResourceUsageData, FunctionsResourceUsageError, TData>({
queryKey: analyticsKeys.functionsResourceUsage(projectRef, { functionId, interval }),
diff --git a/apps/studio/data/analytics/infra-monitoring-query.ts b/apps/studio/data/analytics/infra-monitoring-query.ts
index e57ecc3a507..57acc306bb8 100644
--- a/apps/studio/data/analytics/infra-monitoring-query.ts
+++ b/apps/studio/data/analytics/infra-monitoring-query.ts
@@ -1,9 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { get, handleError } from 'data/fetchers'
import type { AnalyticsData, AnalyticsInterval } from './constants'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type InfraMonitoringAttribute =
| 'max_cpu_usage'
@@ -76,7 +77,7 @@ export const useInfraMonitoringQuery = <TData = InfraMonitoringData>(
{
enabled = true,
...options
- }: UseQueryOptions<InfraMonitoringData, InfraMonitoringError, TData> = {}
+ }: UseCustomQueryOptions<InfraMonitoringData, InfraMonitoringError, TData> = {}
) =>
useQuery<InfraMonitoringData, InfraMonitoringError, TData>({
queryKey: analyticsKeys.infraMonitoring(projectRef, {
diff --git a/apps/studio/data/analytics/org-daily-stats-query.ts b/apps/studio/data/analytics/org-daily-stats-query.ts
index c6d0e247b77..fae49b3b4d1 100644
--- a/apps/studio/data/analytics/org-daily-stats-query.ts
+++ b/apps/studio/data/analytics/org-daily-stats-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { analyticsKeys } from './keys'
export enum EgressType {
@@ -149,7 +149,10 @@ export type OrgDailyStatsError = ResponseError
export const useOrgDailyStatsQuery = <TData = OrgDailyStatsData>(
{ orgSlug, startDate, endDate, projectRef }: OrgDailyStatsVariables,
- { enabled = true, ...options }: UseQueryOptions<OrgDailyStatsData, OrgDailyStatsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<OrgDailyStatsData, OrgDailyStatsError, TData> = {}
) =>
useQuery<OrgDailyStatsData, OrgDailyStatsError, TData>({
queryKey: analyticsKeys.orgDailyStats(orgSlug, { startDate, endDate, projectRef }),
diff --git a/apps/studio/data/analytics/project-daily-stats-query.ts b/apps/studio/data/analytics/project-daily-stats-query.ts
index 610a87397ca..03308280cd1 100644
--- a/apps/studio/data/analytics/project-daily-stats-query.ts
+++ b/apps/studio/data/analytics/project-daily-stats-query.ts
@@ -1,9 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
import type { AnalyticsData } from './constants'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type ProjectDailyStatsAttribute =
operations['DailyStatsController_getDailyStats']['parameters']['query']['attribute']
@@ -48,7 +49,7 @@ export const useProjectDailyStatsQuery = <TData = ProjectDailyStatsData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectDailyStatsData, ProjectDailyStatsError, TData> = {}
+ }: UseCustomQueryOptions<ProjectDailyStatsData, ProjectDailyStatsError, TData> = {}
) =>
useQuery<ProjectDailyStatsData, ProjectDailyStatsError, TData>({
queryKey: analyticsKeys.infraMonitoring(projectRef, {
diff --git a/apps/studio/data/analytics/project-log-requests-count-query.ts b/apps/studio/data/analytics/project-log-requests-count-query.ts
index bc1064a01d1..e8ef75ffb50 100644
--- a/apps/studio/data/analytics/project-log-requests-count-query.ts
+++ b/apps/studio/data/analytics/project-log-requests-count-query.ts
@@ -1,7 +1,7 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { analyticsKeys } from './keys'
export type ProjectLogRequestsCountVariables = {
@@ -38,7 +38,7 @@ export const useProjectLogRequestsCountQuery = <TData = ProjectLogRequestsCountD
{
enabled = true,
...options
- }: UseQueryOptions<ProjectLogRequestsCountData, ProjectLogRequestsCountError, TData> = {}
+ }: UseCustomQueryOptions<ProjectLogRequestsCountData, ProjectLogRequestsCountError, TData> = {}
) =>
useQuery<ProjectLogRequestsCountData, ProjectLogRequestsCountError, TData>({
queryKey: analyticsKeys.usageApiRequestsCount(projectRef),
diff --git a/apps/studio/data/analytics/project-log-stats-query.ts b/apps/studio/data/analytics/project-log-stats-query.ts
index e9668785123..d50cb53fdf0 100644
--- a/apps/studio/data/analytics/project-log-stats-query.ts
+++ b/apps/studio/data/analytics/project-log-stats-query.ts
@@ -1,7 +1,8 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { analyticsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type ProjectLogStatsVariables = {
projectRef?: string
@@ -58,7 +59,7 @@ export const useProjectLogStatsQuery = <TData = ProjectLogStatsData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectLogStatsData, ProjectLogStatsError, TData> = {}
+ }: UseCustomQueryOptions<ProjectLogStatsData, ProjectLogStatsError, TData> = {}
) =>
useQuery<ProjectLogStatsData, ProjectLogStatsError, TData>({
queryKey: analyticsKeys.usageApiCounts(projectRef, interval),
diff --git a/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts b/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts
index 832c71149b5..6d548342fe8 100644
--- a/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts
+++ b/apps/studio/data/api-authorization/api-authorization-approve-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ApiAuthorizationApproveVariables = {
id: string
@@ -33,7 +33,11 @@ export const useApiAuthorizationApproveMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ApiAuthorizationApproveData, ResponseError, ApiAuthorizationApproveVariables>,
+ UseCustomMutationOptions<
+ ApiAuthorizationApproveData,
+ ResponseError,
+ ApiAuthorizationApproveVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<ApiAuthorizationApproveData, ResponseError, ApiAuthorizationApproveVariables>({
diff --git a/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts b/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts
index bf1eec660ec..9f47d22cdeb 100644
--- a/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts
+++ b/apps/studio/data/api-authorization/api-authorization-decline-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ApiAuthorizationDeclineVariables = {
id: string
@@ -32,7 +32,11 @@ export const useApiAuthorizationDeclineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ApiAuthorizationDeclineData, ResponseError, ApiAuthorizationDeclineVariables>,
+ UseCustomMutationOptions<
+ ApiAuthorizationDeclineData,
+ ResponseError,
+ ApiAuthorizationDeclineVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<ApiAuthorizationDeclineData, ResponseError, ApiAuthorizationDeclineVariables>({
diff --git a/apps/studio/data/api-authorization/api-authorization-query.ts b/apps/studio/data/api-authorization/api-authorization-query.ts
index bfe1f9a7cc6..92f8672caa4 100644
--- a/apps/studio/data/api-authorization/api-authorization-query.ts
+++ b/apps/studio/data/api-authorization/api-authorization-query.ts
@@ -1,8 +1,9 @@
import type { OAuthScope } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { resourceKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type ApiAuthorizationVariables = {
id?: string
@@ -40,7 +41,7 @@ export type ResourceError = { errorEventId: string; message: string }
export const useApiAuthorizationQuery = <TData = ResourceData>(
{ id }: ApiAuthorizationVariables,
- { enabled = true, ...options }: UseQueryOptions<ResourceData, ResourceError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ResourceData, ResourceError, TData> = {}
) =>
useQuery<ResourceData, ResourceError, TData>({
queryKey: resourceKeys.resource(id),
diff --git a/apps/studio/data/api-keys/[id]/api-key-id-query.ts b/apps/studio/data/api-keys/[id]/api-key-id-query.ts
index b143f24e40e..1de58426adc 100644
--- a/apps/studio/data/api-keys/[id]/api-key-id-query.ts
+++ b/apps/studio/data/api-keys/[id]/api-key-id-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { apiKeysKeys } from './../keys'
export interface APIKeyVariables {
@@ -35,7 +35,7 @@ export type APIKeyIdData = Awaited<ReturnType<typeof getAPIKeysById>>
export const useAPIKeyIdQuery = <TData = APIKeyIdData>(
{ projectRef, id, reveal }: APIKeyVariables,
- { enabled = true, ...options }: UseQueryOptions<APIKeyIdData, ResponseError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<APIKeyIdData, ResponseError, TData> = {}
) =>
useQuery<APIKeyIdData, ResponseError, TData>({
queryKey: apiKeysKeys.single(projectRef, id),
diff --git a/apps/studio/data/api-keys/[id]/api-key-id-update-mutation.ts b/apps/studio/data/api-keys/[id]/api-key-id-update-mutation.ts
index 2af09655ba0..4fbbcb20648 100644
--- a/apps/studio/data/api-keys/[id]/api-key-id-update-mutation.ts
+++ b/apps/studio/data/api-keys/[id]/api-key-id-update-mutation.ts
@@ -1,8 +1,8 @@
import { toast } from 'sonner'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { apiKeysKeys } from '../keys'
export interface UpdateAPIKeybyIdVariables {
@@ -43,7 +43,7 @@ export const useResourceUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ResourceUpdateData, ResponseError, UpdateAPIKeybyIdVariables>,
+ UseCustomMutationOptions<ResourceUpdateData, ResponseError, UpdateAPIKeybyIdVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/api-keys/api-key-create-mutation.ts b/apps/studio/data/api-keys/api-key-create-mutation.ts
index 65d50087034..9c5562e2bf9 100644
--- a/apps/studio/data/api-keys/api-key-create-mutation.ts
+++ b/apps/studio/data/api-keys/api-key-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { apiKeysKeys } from './keys'
export type APIKeyCreateVariables = {
@@ -58,7 +58,7 @@ export const useAPIKeyCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<APIKeyCreateData, ResponseError, APIKeyCreateVariables>,
+ UseCustomMutationOptions<APIKeyCreateData, ResponseError, APIKeyCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/api-keys/api-key-delete-mutation.ts b/apps/studio/data/api-keys/api-key-delete-mutation.ts
index 7ad3e9b1b75..fd290dbda95 100644
--- a/apps/studio/data/api-keys/api-key-delete-mutation.ts
+++ b/apps/studio/data/api-keys/api-key-delete-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { del, handleError } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { apiKeysKeys } from './keys'
export type APIKeyDeleteVariables = {
@@ -30,7 +30,7 @@ export const useAPIKeyDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<APIKeyDeleteData, ResponseError, APIKeyDeleteVariables>,
+ UseCustomMutationOptions<APIKeyDeleteData, ResponseError, APIKeyDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/api-keys/api-keys-query.ts b/apps/studio/data/api-keys/api-keys-query.ts
index 36a93b83f53..4f94bd35599 100644
--- a/apps/studio/data/api-keys/api-keys-query.ts
+++ b/apps/studio/data/api-keys/api-keys-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { apiKeysKeys } from './keys'
type LegacyKeys = {
@@ -68,7 +68,7 @@ export type APIKeysData = Awaited<ReturnType<typeof getAPIKeys>>
export const useAPIKeysQuery = <TData = APIKeysData>(
{ projectRef, reveal = false }: APIKeysVariables,
- { enabled = true, ...options }: UseQueryOptions<APIKeysData, ResponseError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<APIKeysData, ResponseError, TData> = {}
) => {
return useQuery<APIKeysData, ResponseError, TData>({
queryKey: apiKeysKeys.list(projectRef, reveal),
diff --git a/apps/studio/data/api-keys/legacy-api-key-toggle-mutation.ts b/apps/studio/data/api-keys/legacy-api-key-toggle-mutation.ts
index 23c25d44bbc..5fbb64148f5 100644
--- a/apps/studio/data/api-keys/legacy-api-key-toggle-mutation.ts
+++ b/apps/studio/data/api-keys/legacy-api-key-toggle-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, put } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { apiKeysKeys } from './keys'
export type ToggleLegacyAPIKeysVariables = {
@@ -30,7 +30,7 @@ export const useToggleLegacyAPIKeysMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ToggleLegacyAPIKeysData, ResponseError, ToggleLegacyAPIKeysVariables>,
+ UseCustomMutationOptions<ToggleLegacyAPIKeysData, ResponseError, ToggleLegacyAPIKeysVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/api-keys/legacy-api-keys-status-query.ts b/apps/studio/data/api-keys/legacy-api-keys-status-query.ts
index 33c812b72eb..a513906d3b9 100644
--- a/apps/studio/data/api-keys/legacy-api-keys-status-query.ts
+++ b/apps/studio/data/api-keys/legacy-api-keys-status-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { apiKeysKeys } from './keys'
interface LegacyAPIKeysStatusVariables {
@@ -31,7 +31,7 @@ export const useLegacyAPIKeysStatusQuery = <TData = LegacyAPIKeysStatusData>(
{
enabled = true,
...options
- }: UseQueryOptions<LegacyAPIKeysStatusData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<LegacyAPIKeysStatusData, ResponseError, TData> = {}
) =>
useQuery<LegacyAPIKeysStatusData, ResponseError, TData>({
queryKey: apiKeysKeys.status(projectRef),
diff --git a/apps/studio/data/api-keys/temp-api-keys-query.ts b/apps/studio/data/api-keys/temp-api-keys-query.ts
index 5d27625ef3a..eed65a90814 100644
--- a/apps/studio/data/api-keys/temp-api-keys-query.ts
+++ b/apps/studio/data/api-keys/temp-api-keys-query.ts
@@ -1,7 +1,7 @@
-import { type UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { apiKeysKeys } from './keys'
interface getTemporaryAPIKeyVariables {
@@ -36,7 +36,10 @@ export type TemporaryAPIKeyData = Awaited<ReturnType<typeof getTemporaryAPIKey>>
export const useTemporaryAPIKeyQuery = <TData = TemporaryAPIKeyData>(
{ projectRef, expiry = 300 }: getTemporaryAPIKeyVariables,
- { enabled = true, ...options }: UseQueryOptions<TemporaryAPIKeyData, ResponseError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<TemporaryAPIKeyData, ResponseError, TData> = {}
) => {
return useQuery<TemporaryAPIKeyData, ResponseError, TData>({
queryKey: apiKeysKeys.temporary(projectRef),
diff --git a/apps/studio/data/api-settings/create-and-expose-api-schema-mutation.ts b/apps/studio/data/api-settings/create-and-expose-api-schema-mutation.ts
index c331557c1f5..6eca1b957a5 100644
--- a/apps/studio/data/api-settings/create-and-expose-api-schema-mutation.ts
+++ b/apps/studio/data/api-settings/create-and-expose-api-schema-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { configKeys } from 'data/config/keys'
import { databaseKeys } from 'data/database/keys'
import { handleError, patch } from 'data/fetchers'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type CreateAndExposeAPISchemaVariables = {
projectRef: string
@@ -52,7 +52,7 @@ export const useCreateAndExposeAPISchemaMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
CreateAndExposeAPISchemaData,
ResponseError,
CreateAndExposeAPISchemaVariables
diff --git a/apps/studio/data/auth/auth-config-query.ts b/apps/studio/data/auth/auth-config-query.ts
index 466c28339a9..514157b29d1 100644
--- a/apps/studio/data/auth/auth-config-query.ts
+++ b/apps/studio/data/auth/auth-config-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
import { useCallback } from 'react'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { authKeys } from './keys'
export type AuthConfigVariables = {
@@ -35,7 +35,7 @@ export const useAuthConfigQuery = <TData = ProjectAuthConfigData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectAuthConfigData, ProjectAuthConfigError, TData> = {}
+ }: UseCustomQueryOptions<ProjectAuthConfigData, ProjectAuthConfigError, TData> = {}
) =>
useQuery<ProjectAuthConfigData, ProjectAuthConfigError, TData>({
queryKey: authKeys.authConfig(projectRef),
diff --git a/apps/studio/data/auth/auth-config-update-mutation.ts b/apps/studio/data/auth/auth-config-update-mutation.ts
index 322165a466e..75f88d4d5e6 100644
--- a/apps/studio/data/auth/auth-config-update-mutation.ts
+++ b/apps/studio/data/auth/auth-config-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type AuthConfigUpdateVariables = {
@@ -32,7 +32,7 @@ export const useAuthConfigUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AuthConfigUpdateData, ResponseError, AuthConfigUpdateVariables>,
+ UseCustomMutationOptions<AuthConfigUpdateData, ResponseError, AuthConfigUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/auth-hooks-update-mutation.ts b/apps/studio/data/auth/auth-hooks-update-mutation.ts
index 10b00616cf8..7da20512265 100644
--- a/apps/studio/data/auth/auth-hooks-update-mutation.ts
+++ b/apps/studio/data/auth/auth-hooks-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type AuthHooksUpdateVariables = {
@@ -28,7 +28,7 @@ export const useAuthHooksUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AuthHooksUpdateData, ResponseError, AuthHooksUpdateVariables>,
+ UseCustomMutationOptions<AuthHooksUpdateData, ResponseError, AuthHooksUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/session-access-token-query.ts b/apps/studio/data/auth/session-access-token-query.ts
index d335e3ed6a6..b72fb1820e6 100644
--- a/apps/studio/data/auth/session-access-token-query.ts
+++ b/apps/studio/data/auth/session-access-token-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { getAccessToken } from 'common'
import { authKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export async function getSessionAccessToken() {
// ignore if server-side
@@ -21,7 +22,7 @@ export type SessionAccessTokenError = unknown
export const useSessionAccessTokenQuery = <TData = SessionAccessTokenData>({
enabled = true,
...options
-}: UseQueryOptions<SessionAccessTokenData, SessionAccessTokenError, TData> = {}) =>
+}: UseCustomQueryOptions<SessionAccessTokenData, SessionAccessTokenError, TData> = {}) =>
useQuery<SessionAccessTokenData, SessionAccessTokenError, TData>({
queryKey: authKeys.accessToken(),
queryFn: () => getSessionAccessToken(),
diff --git a/apps/studio/data/auth/user-create-mutation.ts b/apps/studio/data/auth/user-create-mutation.ts
index f199977e79a..c6a56e15ba9 100644
--- a/apps/studio/data/auth/user-create-mutation.ts
+++ b/apps/studio/data/auth/user-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type UserCreateVariables = {
@@ -34,7 +34,7 @@ export const useUserCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserCreateData, ResponseError, UserCreateVariables>,
+ UseCustomMutationOptions<UserCreateData, ResponseError, UserCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts b/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts
index 7ae5937528b..d27a9526d5c 100644
--- a/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts
+++ b/apps/studio/data/auth/user-delete-mfa-factors-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type UserDeleteMFAFactorsVariables = {
projectRef: string
@@ -26,7 +26,7 @@ export const useUserDeleteMFAFactorsMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserDeleteMFAFactorsData, ResponseError, UserDeleteMFAFactorsVariables>,
+ UseCustomMutationOptions<UserDeleteMFAFactorsData, ResponseError, UserDeleteMFAFactorsVariables>,
'mutationFn'
> = {}) => {
return useMutation<UserDeleteMFAFactorsData, ResponseError, UserDeleteMFAFactorsVariables>({
diff --git a/apps/studio/data/auth/user-delete-mutation.ts b/apps/studio/data/auth/user-delete-mutation.ts
index ffa29246567..17e0d9bd482 100644
--- a/apps/studio/data/auth/user-delete-mutation.ts
+++ b/apps/studio/data/auth/user-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type UserDeleteVariables = {
@@ -26,7 +26,7 @@ export const useUserDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserDeleteData, ResponseError, UserDeleteVariables>,
+ UseCustomMutationOptions<UserDeleteData, ResponseError, UserDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/user-invite-mutation.ts b/apps/studio/data/auth/user-invite-mutation.ts
index e493f0a892b..15e149e72ee 100644
--- a/apps/studio/data/auth/user-invite-mutation.ts
+++ b/apps/studio/data/auth/user-invite-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type UserInviteVariables = {
@@ -26,7 +26,7 @@ export const useUserInviteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserInviteData, ResponseError, UserInviteVariables>,
+ UseCustomMutationOptions<UserInviteData, ResponseError, UserInviteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/user-reset-password-mutation.ts b/apps/studio/data/auth/user-reset-password-mutation.ts
index d39a5a9a692..fa1f5b22d4d 100644
--- a/apps/studio/data/auth/user-reset-password-mutation.ts
+++ b/apps/studio/data/auth/user-reset-password-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { User } from './users-infinite-query'
export type UserResetPasswordVariables = {
@@ -28,7 +28,7 @@ export const useUserResetPasswordMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserResetPasswordData, ResponseError, UserResetPasswordVariables>,
+ UseCustomMutationOptions<UserResetPasswordData, ResponseError, UserResetPasswordVariables>,
'mutationFn'
> = {}) => {
return useMutation<UserResetPasswordData, ResponseError, UserResetPasswordVariables>({
diff --git a/apps/studio/data/auth/user-send-magic-link-mutation.ts b/apps/studio/data/auth/user-send-magic-link-mutation.ts
index 127fb33a313..cf3eca6b50a 100644
--- a/apps/studio/data/auth/user-send-magic-link-mutation.ts
+++ b/apps/studio/data/auth/user-send-magic-link-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { User } from './users-infinite-query'
export type UserSendMagicLinkVariables = {
@@ -28,7 +28,7 @@ export const useUserSendMagicLinkMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserSendMagicLinkData, ResponseError, UserSendMagicLinkVariables>,
+ UseCustomMutationOptions<UserSendMagicLinkData, ResponseError, UserSendMagicLinkVariables>,
'mutationFn'
> = {}) => {
return useMutation<UserSendMagicLinkData, ResponseError, UserSendMagicLinkVariables>({
diff --git a/apps/studio/data/auth/user-send-otp-mutation.ts b/apps/studio/data/auth/user-send-otp-mutation.ts
index 6072fcb969c..ab780629642 100644
--- a/apps/studio/data/auth/user-send-otp-mutation.ts
+++ b/apps/studio/data/auth/user-send-otp-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { User } from './users-infinite-query'
export type UserSendOTPVariables = {
@@ -28,7 +28,7 @@ export const useUserSendOTPMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserSendOTPData, ResponseError, UserSendOTPVariables>,
+ UseCustomMutationOptions<UserSendOTPData, ResponseError, UserSendOTPVariables>,
'mutationFn'
> = {}) => {
return useMutation<UserSendOTPData, ResponseError, UserSendOTPVariables>({
diff --git a/apps/studio/data/auth/user-update-mutation.ts b/apps/studio/data/auth/user-update-mutation.ts
index d65b40604a8..986a2416a1e 100644
--- a/apps/studio/data/auth/user-update-mutation.ts
+++ b/apps/studio/data/auth/user-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { authKeys } from './keys'
export type UserUpdateVariables = {
@@ -29,7 +29,7 @@ export const useUserUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UserUpdateData, ResponseError, UserUpdateVariables>,
+ UseCustomMutationOptions<UserUpdateData, ResponseError, UserUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/auth/users-count-query.ts b/apps/studio/data/auth/users-count-query.ts
index 67052362022..434d45a13a0 100644
--- a/apps/studio/data/auth/users-count-query.ts
+++ b/apps/studio/data/auth/users-count-query.ts
@@ -1,7 +1,8 @@
import { getUsersCountSQL } from '@supabase/pg-meta/src/sql/studio/get-users-count'
-import { useQuery, type UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, type ExecuteSqlError } from 'data/sql/execute-sql-query'
+import { UseCustomQueryOptions } from 'types'
import { authKeys } from './keys'
import { type Filter } from './users-infinite-query'
@@ -63,7 +64,7 @@ export const useUsersCountQuery = <TData = UsersCountData>(
providers,
forceExactCount,
}: UsersCountVariables,
- { enabled = true, ...options }: UseQueryOptions<UsersCountData, UsersCountError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<UsersCountData, UsersCountError, TData> = {}
) =>
useQuery<UsersCountData, UsersCountError, TData>({
queryKey: authKeys.usersCount(projectRef, {
diff --git a/apps/studio/data/auth/users-infinite-query.ts b/apps/studio/data/auth/users-infinite-query.ts
index 2447d5656b6..0d360f0d9e7 100644
--- a/apps/studio/data/auth/users-infinite-query.ts
+++ b/apps/studio/data/auth/users-infinite-query.ts
@@ -1,10 +1,11 @@
import { getPaginatedUsersSQL } from '@supabase/pg-meta/src/sql/studio/get-users-paginated'
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { executeSql, ExecuteSqlError } from 'data/sql/execute-sql-query'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
+import { UseCustomInfiniteQueryOptions } from 'types'
import { authKeys } from './keys'
const USERS_PAGE_LIMIT = 50
@@ -38,7 +39,7 @@ export const useUsersInfiniteQuery = <TData = UsersData>(
order,
column,
}: UsersVariables,
- { enabled = true, ...options }: UseInfiniteQueryOptions<UsersData, UsersError, TData> = {}
+ { enabled = true, ...options }: UseCustomInfiniteQueryOptions<UsersData, UsersError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/auth/validate-spam-mutation.ts b/apps/studio/data/auth/validate-spam-mutation.ts
index 920a025f7d7..067b8945f07 100644
--- a/apps/studio/data/auth/validate-spam-mutation.ts
+++ b/apps/studio/data/auth/validate-spam-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ValidateSpamVariables = {
projectRef: string
@@ -29,7 +29,7 @@ export const useValidateSpamMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ValidateSpamData, ResponseError, ValidateSpamVariables>,
+ UseCustomMutationOptions<ValidateSpamData, ResponseError, ValidateSpamVariables>,
'mutationFn'
> = {}) => {
return useMutation<ValidateSpamData, ResponseError, ValidateSpamVariables>({
diff --git a/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts b/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts
index 8cbda71f254..1d592df0764 100644
--- a/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts
+++ b/apps/studio/data/banned-ips/banned-ips-delete-mutations.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { BannedIPKeys } from './keys'
export type IPDeleteVariables = {
@@ -29,7 +29,10 @@ export const useBannedIPsDeleteMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<IPDeleteData, ResponseError, IPDeleteVariables>, 'mutationFn'> = {}) => {
+}: Omit<
+ UseCustomMutationOptions<IPDeleteData, ResponseError, IPDeleteVariables>,
+ 'mutationFn'
+> = {}) => {
const queryClient = useQueryClient()
return useMutation<IPDeleteData, ResponseError, IPDeleteVariables>({
mutationFn: (vars) => deleteBannedIPs(vars),
diff --git a/apps/studio/data/banned-ips/banned-ips-query.ts b/apps/studio/data/banned-ips/banned-ips-query.ts
index 710b68c3fb0..e79a52f9913 100644
--- a/apps/studio/data/banned-ips/banned-ips-query.ts
+++ b/apps/studio/data/banned-ips/banned-ips-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { BannedIPKeys } from './keys'
export type BannedIPVariables = {
@@ -28,7 +28,7 @@ export type IPError = ResponseError
export const useBannedIPsQuery = <TData = IPData>(
{ projectRef }: BannedIPVariables,
- { enabled = true, ...options }: UseQueryOptions<IPData, IPError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<IPData, IPError, TData> = {}
) =>
useQuery<IPData, IPError, TData>({
queryKey: BannedIPKeys.list(projectRef),
diff --git a/apps/studio/data/branches/branch-create-mutation.ts b/apps/studio/data/branches/branch-create-mutation.ts
index fb3ffaa181e..b03bcf95a05 100644
--- a/apps/studio/data/branches/branch-create-mutation.ts
+++ b/apps/studio/data/branches/branch-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { branchKeys } from './keys'
export type BranchCreateVariables = {
@@ -48,7 +48,7 @@ export const useBranchCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchCreateData, ResponseError, BranchCreateVariables>,
+ UseCustomMutationOptions<BranchCreateData, ResponseError, BranchCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branch-delete-mutation.ts b/apps/studio/data/branches/branch-delete-mutation.ts
index ef7381eca44..55d52338ded 100644
--- a/apps/studio/data/branches/branch-delete-mutation.ts
+++ b/apps/studio/data/branches/branch-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { BranchesData } from './branches-query'
import { branchKeys } from './keys'
@@ -27,7 +27,7 @@ export const useBranchDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchDeleteData, ResponseError, BranchDeleteVariables>,
+ UseCustomMutationOptions<BranchDeleteData, ResponseError, BranchDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branch-diff-query.ts b/apps/studio/data/branches/branch-diff-query.ts
index a3976d63a65..bec96019640 100644
--- a/apps/studio/data/branches/branch-diff-query.ts
+++ b/apps/studio/data/branches/branch-diff-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { branchKeys } from './keys'
export type BranchDiffVariables = {
@@ -45,7 +45,7 @@ export const useBranchDiffQuery = (
{
enabled = true,
...options
- }: Omit<UseQueryOptions<BranchDiffData, ResponseError>, 'queryKey' | 'queryFn'> = {}
+ }: Omit<UseCustomQueryOptions<BranchDiffData, ResponseError>, 'queryKey' | 'queryFn'> = {}
) =>
useQuery<BranchDiffData, ResponseError>({
queryKey: branchKeys.diff(projectRef, branchRef),
diff --git a/apps/studio/data/branches/branch-merge-mutation.ts b/apps/studio/data/branches/branch-merge-mutation.ts
index 5da2ecdf746..9155bf41464 100644
--- a/apps/studio/data/branches/branch-merge-mutation.ts
+++ b/apps/studio/data/branches/branch-merge-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { upsertMigration } from '../database/migration-upsert-mutation'
import { getBranchDiff } from './branch-diff-query'
import { branchKeys } from './keys'
@@ -59,7 +59,7 @@ export const useBranchMergeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchMergeData, ResponseError, BranchMergeVariables>,
+ UseCustomMutationOptions<BranchMergeData, ResponseError, BranchMergeVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branch-push-mutation.ts b/apps/studio/data/branches/branch-push-mutation.ts
index d90c72ce0aa..499b091ccb5 100644
--- a/apps/studio/data/branches/branch-push-mutation.ts
+++ b/apps/studio/data/branches/branch-push-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { branchKeys } from './keys'
export type BranchPushVariables = {
@@ -27,7 +27,7 @@ export const useBranchPushMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchPushData, ResponseError, BranchPushVariables>,
+ UseCustomMutationOptions<BranchPushData, ResponseError, BranchPushVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branch-query.ts b/apps/studio/data/branches/branch-query.ts
index 03c83a3e88f..c22d6fd3cf5 100644
--- a/apps/studio/data/branches/branch-query.ts
+++ b/apps/studio/data/branches/branch-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { branchKeys } from './keys'
export type BranchVariables = {
@@ -27,7 +27,7 @@ export type BranchError = ResponseError
export const useBranchQuery = <TData = BranchData>(
{ projectRef, branchRef }: BranchVariables,
- { enabled = true, ...options }: UseQueryOptions<BranchData, BranchError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<BranchData, BranchError, TData> = {}
) =>
useQuery<BranchData, BranchError, TData>({
queryKey: branchKeys.detail(projectRef, branchRef),
diff --git a/apps/studio/data/branches/branch-reset-mutation.ts b/apps/studio/data/branches/branch-reset-mutation.ts
index 6be95f3c0da..7654bc90801 100644
--- a/apps/studio/data/branches/branch-reset-mutation.ts
+++ b/apps/studio/data/branches/branch-reset-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { branchKeys } from './keys'
export type BranchResetVariables = {
@@ -27,7 +27,7 @@ export const useBranchResetMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchResetData, ResponseError, BranchResetVariables>,
+ UseCustomMutationOptions<BranchResetData, ResponseError, BranchResetVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branch-update-mutation.ts b/apps/studio/data/branches/branch-update-mutation.ts
index 0dc4cd28f73..90674f6ced8 100644
--- a/apps/studio/data/branches/branch-update-mutation.ts
+++ b/apps/studio/data/branches/branch-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { branchKeys } from './keys'
export type BranchUpdateVariables = {
@@ -44,7 +44,7 @@ export const useBranchUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BranchUpdateData, ResponseError, BranchUpdateVariables>,
+ UseCustomMutationOptions<BranchUpdateData, ResponseError, BranchUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/branches/branches-query.ts b/apps/studio/data/branches/branches-query.ts
index cf4f95f4b17..e4191a80cc2 100644
--- a/apps/studio/data/branches/branches-query.ts
+++ b/apps/studio/data/branches/branches-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { branchKeys } from './keys'
export type BranchesVariables = {
@@ -36,7 +36,7 @@ export type BranchesError = ResponseError
export const useBranchesQuery = <TData = BranchesData>(
{ projectRef }: BranchesVariables,
- { enabled = true, ...options }: UseQueryOptions<BranchesData, BranchesError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<BranchesData, BranchesError, TData> = {}
) =>
useQuery<BranchesData, BranchesError, TData>({
queryKey: branchKeys.list(projectRef),
diff --git a/apps/studio/data/config/disk-attributes-query.ts b/apps/studio/data/config/disk-attributes-query.ts
index eb5f49cb59e..07c1b9ced35 100644
--- a/apps/studio/data/config/disk-attributes-query.ts
+++ b/apps/studio/data/config/disk-attributes-query.ts
@@ -1,10 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { useMemo } from 'react'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { COOLDOWN_DURATION } from './disk-attributes-update-mutation'
import { configKeys } from './keys'
@@ -37,7 +37,7 @@ export const useDiskAttributesQuery = <TData = DiskAttributesData>(
{
enabled = true,
...options
- }: UseQueryOptions<DiskAttributesData, DiskAttributesError, TData> = {}
+ }: UseCustomQueryOptions<DiskAttributesData, DiskAttributesError, TData> = {}
) =>
useQuery<DiskAttributesData, DiskAttributesError, TData>({
queryKey: configKeys.diskAttributes(projectRef),
diff --git a/apps/studio/data/config/disk-attributes-update-mutation.ts b/apps/studio/data/config/disk-attributes-update-mutation.ts
index ddbfead579b..9a090d9e2a2 100644
--- a/apps/studio/data/config/disk-attributes-update-mutation.ts
+++ b/apps/studio/data/config/disk-attributes-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
export const COOLDOWN_DURATION = 60 * 60 * 6
@@ -50,7 +50,7 @@ export const useUpdateDiskAttributesMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateDiskAttributesData, ResponseError, UpdateDiskAttributesVariables>,
+ UseCustomMutationOptions<UpdateDiskAttributesData, ResponseError, UpdateDiskAttributesVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/config/disk-autoscale-config-query.ts b/apps/studio/data/config/disk-autoscale-config-query.ts
index 6d44f7f8b0b..146d911d70c 100644
--- a/apps/studio/data/config/disk-autoscale-config-query.ts
+++ b/apps/studio/data/config/disk-autoscale-config-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type DiskAutoscaleCustomConfigVariables = {
@@ -33,7 +33,11 @@ export const useDiskAutoscaleCustomConfigQuery = <TData = DiskAutoscaleCustomCon
{
enabled = true,
...options
- }: UseQueryOptions<DiskAutoscaleCustomConfigData, DiskAutoscaleCustomConfigError, TData> = {}
+ }: UseCustomQueryOptions<
+ DiskAutoscaleCustomConfigData,
+ DiskAutoscaleCustomConfigError,
+ TData
+ > = {}
) =>
useQuery<DiskAutoscaleCustomConfigData, DiskAutoscaleCustomConfigError, TData>({
queryKey: configKeys.diskAutoscaleConfig(projectRef),
diff --git a/apps/studio/data/config/disk-autoscale-config-update-mutation.ts b/apps/studio/data/config/disk-autoscale-config-update-mutation.ts
index 13a30ad319c..d1788cc5e77 100644
--- a/apps/studio/data/config/disk-autoscale-config-update-mutation.ts
+++ b/apps/studio/data/config/disk-autoscale-config-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
export type UpdateDiskAutoscaleConfigVariables = {
@@ -41,7 +41,7 @@ export const useUpdateDiskAutoscaleConfigMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
UpdateDiskAutoscaleConfigData,
ResponseError,
UpdateDiskAutoscaleConfigVariables
diff --git a/apps/studio/data/config/disk-breakdown-query.ts b/apps/studio/data/config/disk-breakdown-query.ts
index 757a289735c..2e2c9b7e0f2 100644
--- a/apps/studio/data/config/disk-breakdown-query.ts
+++ b/apps/studio/data/config/disk-breakdown-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
-import type { ResponseError } from 'types'
-import { configKeys } from './keys'
import { executeSql } from 'data/sql/execute-sql-query'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
+import { configKeys } from './keys'
export type DiskBreakdownVariables = {
projectRef?: string
@@ -50,7 +50,10 @@ export type DiskBreakdownError = ResponseError
export const useDiskBreakdownQuery = <TData = DiskBreakdownData>(
{ projectRef, connectionString }: DiskBreakdownVariables,
- { enabled = true, ...options }: UseQueryOptions<DiskBreakdownData, DiskBreakdownError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DiskBreakdownData, DiskBreakdownError, TData> = {}
) =>
useQuery<DiskBreakdownData, DiskBreakdownError, TData>({
queryKey: configKeys.diskBreakdown(projectRef),
diff --git a/apps/studio/data/config/disk-utilization-query.ts b/apps/studio/data/config/disk-utilization-query.ts
index 3e7a5f394f0..0f7c8903c8b 100644
--- a/apps/studio/data/config/disk-utilization-query.ts
+++ b/apps/studio/data/config/disk-utilization-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type DiskUtilizationVariables = {
@@ -31,7 +31,7 @@ export const useDiskUtilizationQuery = <TData = DiskUtilizationData>(
{
enabled = true,
...options
- }: UseQueryOptions<DiskUtilizationData, DiskUtilizationError, TData> = {}
+ }: UseCustomQueryOptions<DiskUtilizationData, DiskUtilizationError, TData> = {}
) =>
useQuery<DiskUtilizationData, DiskUtilizationError, TData>({
queryKey: configKeys.diskUtilization(projectRef),
diff --git a/apps/studio/data/config/jwt-secret-update-mutation.ts b/apps/studio/data/config/jwt-secret-update-mutation.ts
index c2ead8572cd..d03d7dff928 100644
--- a/apps/studio/data/config/jwt-secret-update-mutation.ts
+++ b/apps/studio/data/config/jwt-secret-update-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
export type JwtSecretUpdateVariables = {
@@ -37,7 +37,7 @@ export const useJwtSecretUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<JwtSecretUpdateData, ResponseError, JwtSecretUpdateVariables>,
+ UseCustomMutationOptions<JwtSecretUpdateData, ResponseError, JwtSecretUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/config/jwt-secret-updating-status-query.ts b/apps/studio/data/config/jwt-secret-updating-status-query.ts
index 3f0a7167c87..2aa7cbe86be 100644
--- a/apps/studio/data/config/jwt-secret-updating-status-query.ts
+++ b/apps/studio/data/config/jwt-secret-updating-status-query.ts
@@ -1,6 +1,7 @@
import { JwtSecretUpdateStatus } from '@supabase/shared-types/out/events'
-import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
+import { UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type JwtSecretUpdatingStatusVariables = {
@@ -49,7 +50,7 @@ export const useJwtSecretUpdatingStatusQuery = <TData = JwtSecretUpdatingStatusD
{
enabled = true,
...options
- }: UseQueryOptions<JwtSecretUpdatingStatusData, JwtSecretUpdatingStatusError, TData> = {}
+ }: UseCustomQueryOptions<JwtSecretUpdatingStatusData, JwtSecretUpdatingStatusError, TData> = {}
) => {
const client = useQueryClient()
diff --git a/apps/studio/data/config/project-compliance-config-mutation.ts b/apps/studio/data/config/project-compliance-config-mutation.ts
index 8218f85b8ff..dd6a11f4190 100644
--- a/apps/studio/data/config/project-compliance-config-mutation.ts
+++ b/apps/studio/data/config/project-compliance-config-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
export type ComplianceConfigUpdateVariables = {
@@ -32,7 +32,11 @@ export const useComplianceConfigUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ComplianceConfigUpdateData, ResponseError, ComplianceConfigUpdateVariables>,
+ UseCustomMutationOptions<
+ ComplianceConfigUpdateData,
+ ResponseError,
+ ComplianceConfigUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/config/project-creation-postgres-versions-query.ts b/apps/studio/data/config/project-creation-postgres-versions-query.ts
index 1f3ecfdf9cc..7ffc09281a3 100644
--- a/apps/studio/data/config/project-creation-postgres-versions-query.ts
+++ b/apps/studio/data/config/project-creation-postgres-versions-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
import { CloudProvider } from 'shared-data'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectCreationPostgresVersionsVariables = {
@@ -37,7 +37,7 @@ export const useProjectCreationPostgresVersionsQuery = <TData = ProjectCreationP
{
enabled = true,
...options
- }: UseQueryOptions<
+ }: UseCustomQueryOptions<
ProjectCreationPostgresVersionData,
ProjectCreationPostgresVersionError,
TData
diff --git a/apps/studio/data/config/project-disk-resize-mutation.ts b/apps/studio/data/config/project-disk-resize-mutation.ts
index da75b76af03..f77fe2f1836 100644
--- a/apps/studio/data/config/project-disk-resize-mutation.ts
+++ b/apps/studio/data/config/project-disk-resize-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { usageKeys } from '../usage/keys'
export type ProjectDiskResizeVariables = {
@@ -35,7 +35,7 @@ export const useProjectDiskResizeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectDiskResizeData, ResponseError, ProjectDiskResizeVariables>,
+ UseCustomMutationOptions<ProjectDiskResizeData, ResponseError, ProjectDiskResizeVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/config/project-postgrest-config-query.ts b/apps/studio/data/config/project-postgrest-config-query.ts
index 5ecea8a8bb7..178defcfb8c 100644
--- a/apps/studio/data/config/project-postgrest-config-query.ts
+++ b/apps/studio/data/config/project-postgrest-config-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectPostgrestConfigVariables = {
@@ -37,7 +37,7 @@ export const useProjectPostgrestConfigQuery = <TData = ProjectPostgrestConfigDat
{
enabled = true,
...options
- }: UseQueryOptions<ProjectPostgrestConfigData, ProjectPostgrestConfigError, TData> = {}
+ }: UseCustomQueryOptions<ProjectPostgrestConfigData, ProjectPostgrestConfigError, TData> = {}
) =>
useQuery<ProjectPostgrestConfigData, ProjectPostgrestConfigError, TData>({
queryKey: configKeys.postgrest(projectRef),
diff --git a/apps/studio/data/config/project-postgrest-config-update-mutation.ts b/apps/studio/data/config/project-postgrest-config-update-mutation.ts
index 43dcfeff8dd..238a7cc0a30 100644
--- a/apps/studio/data/config/project-postgrest-config-update-mutation.ts
+++ b/apps/studio/data/config/project-postgrest-config-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
export type ProjectPostgrestConfigUpdateVariables = {
@@ -46,7 +46,7 @@ export const useProjectPostgrestConfigUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
ProjectPostgrestConfigUpdateData,
ResponseError,
ProjectPostgrestConfigUpdateVariables
diff --git a/apps/studio/data/config/project-settings-v2-query.ts b/apps/studio/data/config/project-settings-v2-query.ts
index 2037b326d46..f43729766e0 100644
--- a/apps/studio/data/config/project-settings-v2-query.ts
+++ b/apps/studio/data/config/project-settings-v2-query.ts
@@ -1,10 +1,10 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectSettingsVariables = { projectRef?: string }
@@ -40,7 +40,7 @@ export const useProjectSettingsV2Query = <TData = ProjectSettingsData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectSettingsData, ProjectSettingsError, TData> = {}
+ }: UseCustomQueryOptions<ProjectSettingsData, ProjectSettingsError, TData> = {}
) => {
// [Joshen] Sync with API perms checking here - shouldReturnApiKeys
// https://github.com/supabase/infrastructure/blob/develop/api/src/routes/platform/projects/ref/settings.controller.ts#L92
diff --git a/apps/studio/data/config/project-storage-config-query.ts b/apps/studio/data/config/project-storage-config-query.ts
index 82cc191b194..310d154e074 100644
--- a/apps/studio/data/config/project-storage-config-query.ts
+++ b/apps/studio/data/config/project-storage-config-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectStorageConfigVariables = {
@@ -43,7 +43,7 @@ export const useProjectStorageConfigQuery = <TData = ProjectStorageConfigData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectStorageConfigData, ProjectStorageConfigError, TData> = {}
+ }: UseCustomQueryOptions<ProjectStorageConfigData, ProjectStorageConfigError, TData> = {}
) =>
useQuery<ProjectStorageConfigData, ProjectStorageConfigError, TData>({
queryKey: configKeys.storage(projectRef),
diff --git a/apps/studio/data/config/project-storage-config-update-mutation.ts b/apps/studio/data/config/project-storage-config-update-mutation.ts
index bb525ef5eed..6f8b262df33 100644
--- a/apps/studio/data/config/project-storage-config-update-mutation.ts
+++ b/apps/studio/data/config/project-storage-config-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { configKeys } from './keys'
type StorageConfigUpdatePayload = components['schemas']['UpdateStorageConfigBody']
@@ -34,7 +34,7 @@ export const useProjectStorageConfigUpdateUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
ProjectStorageConfigUpdateUpdateData,
ResponseError,
ProjectStorageConfigUpdateUpdateVariables
diff --git a/apps/studio/data/config/project-temp-disable-read-only-mutation.ts b/apps/studio/data/config/project-temp-disable-read-only-mutation.ts
index f7995c7e1e1..eaf52adc75b 100644
--- a/apps/studio/data/config/project-temp-disable-read-only-mutation.ts
+++ b/apps/studio/data/config/project-temp-disable-read-only-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
import { usageKeys } from 'data/usage/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type TempDisableReadOnlyModeVariables = {
projectRef: string
@@ -25,7 +25,11 @@ export const useDisableReadOnlyModeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DisableReadOnlyModeData, ResponseError, TempDisableReadOnlyModeVariables>,
+ UseCustomMutationOptions<
+ DisableReadOnlyModeData,
+ ResponseError,
+ TempDisableReadOnlyModeVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/config/project-unpause-postgres-versions-query.ts b/apps/studio/data/config/project-unpause-postgres-versions-query.ts
index 2b62e151fb3..9c9be3cef35 100644
--- a/apps/studio/data/config/project-unpause-postgres-versions-query.ts
+++ b/apps/studio/data/config/project-unpause-postgres-versions-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectUnpausePostgresVersionsVariables = {
@@ -33,7 +33,7 @@ export const useProjectUnpausePostgresVersionsQuery = <TData = ProjectUnpausePos
{
enabled = true,
...options
- }: UseQueryOptions<
+ }: UseCustomQueryOptions<
ProjectUnpausePostgresVersionData,
ProjectUnpausePostgresVersionError,
TData
diff --git a/apps/studio/data/config/project-upgrade-eligibility-query.ts b/apps/studio/data/config/project-upgrade-eligibility-query.ts
index 53516146481..ba890c64501 100644
--- a/apps/studio/data/config/project-upgrade-eligibility-query.ts
+++ b/apps/studio/data/config/project-upgrade-eligibility-query.ts
@@ -1,11 +1,11 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { IS_PLATFORM } from 'common'
import { get, handleError } from 'data/fetchers'
import { useProjectDetailQuery } from 'data/projects/project-detail-query'
import { PROJECT_STATUS } from 'lib/constants/infrastructure'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { configKeys } from './keys'
export type ProjectUpgradeTargetVersion = { postgres_version: string; release_channel: string }
@@ -36,7 +36,11 @@ export const useProjectUpgradeEligibilityQuery = <TData = ProjectUpgradeEligibil
{
enabled = true,
...options
- }: UseQueryOptions<ProjectUpgradeEligibilityData, ProjectUpgradeEligibilityError, TData> = {}
+ }: UseCustomQueryOptions<
+ ProjectUpgradeEligibilityData,
+ ProjectUpgradeEligibilityError,
+ TData
+ > = {}
) => {
const { data: project } = useProjectDetailQuery({ ref: projectRef })
return useQuery<ProjectUpgradeEligibilityData, ProjectUpgradeEligibilityError, TData>({
diff --git a/apps/studio/data/config/project-upgrade-status-query.ts b/apps/studio/data/config/project-upgrade-status-query.ts
index 4489ced536f..a2eb8233f18 100644
--- a/apps/studio/data/config/project-upgrade-status-query.ts
+++ b/apps/studio/data/config/project-upgrade-status-query.ts
@@ -1,8 +1,9 @@
import { DatabaseUpgradeStatus } from '@supabase/shared-types/out/events'
-import { useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { PROJECT_STATUS } from 'lib/constants'
import { configKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type ProjectUpgradingStatusVariables = {
projectRef?: string
@@ -38,7 +39,7 @@ export const useProjectUpgradingStatusQuery = <TData = ProjectUpgradingStatusDat
{
enabled = true,
...options
- }: UseQueryOptions<ProjectUpgradingStatusData, ProjectUpgradingStatusError, TData> = {}
+ }: UseCustomQueryOptions<ProjectUpgradingStatusData, ProjectUpgradingStatusError, TData> = {}
) => {
const client = useQueryClient()
diff --git a/apps/studio/data/content-api/docs-error-codes-query.ts b/apps/studio/data/content-api/docs-error-codes-query.ts
index 58e10dc04bf..878c7beef26 100644
--- a/apps/studio/data/content-api/docs-error-codes-query.ts
+++ b/apps/studio/data/content-api/docs-error-codes-query.ts
@@ -1,8 +1,9 @@
-import { useQuery, type UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeGraphQL } from 'data/graphql/execute'
import { graphql } from 'data/graphql/gql'
import { Service } from 'data/graphql/graphql'
import { contentApiKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
const ErrorCodeQuery = graphql(`
query ErrorCodeQuery($code: String!, $service: Service) {
@@ -33,7 +34,7 @@ export const useErrorCodesQuery = <TData = ErrorCodeDescriptionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<ErrorCodeDescriptionsData, ErrorCodeDescriptionsError, TData> = {}
+ }: UseCustomQueryOptions<ErrorCodeDescriptionsData, ErrorCodeDescriptionsError, TData> = {}
) => {
return useQuery<ErrorCodeDescriptionsData, ErrorCodeDescriptionsError, TData>({
queryKey: contentApiKeys.errorCodes(variables),
diff --git a/apps/studio/data/content/content-count-query.ts b/apps/studio/data/content/content-count-query.ts
index 8b4d6cea696..7ec39630cf9 100644
--- a/apps/studio/data/content/content-count-query.ts
+++ b/apps/studio/data/content/content-count-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { contentKeys } from './keys'
type GetContentCountVariables =
@@ -37,7 +37,7 @@ export type ContentIdError = ResponseError
export const useContentCountQuery = <TData = ContentIdData>(
{ projectRef, type, name }: GetContentCountVariables,
- { enabled = true, ...options }: UseQueryOptions<ContentIdData, ContentIdError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ContentIdData, ContentIdError, TData> = {}
) =>
useQuery<ContentIdData, ContentIdError, TData>({
queryKey: contentKeys.count(projectRef, type, {
diff --git a/apps/studio/data/content/content-delete-mutation.ts b/apps/studio/data/content/content-delete-mutation.ts
index c19b5ac9599..87406dddbfb 100644
--- a/apps/studio/data/content/content-delete-mutation.ts
+++ b/apps/studio/data/content/content-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { contentKeys } from './keys'
type DeleteContentVariables = { projectRef: string; ids: string[] }
@@ -31,7 +31,7 @@ export const useContentDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DeleteContentData, ResponseError, DeleteContentVariables>,
+ UseCustomMutationOptions<DeleteContentData, ResponseError, DeleteContentVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/content/content-id-query.ts b/apps/studio/data/content/content-id-query.ts
index e9d79ec8f61..74c3c828827 100644
--- a/apps/studio/data/content/content-id-query.ts
+++ b/apps/studio/data/content/content-id-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import type { Content } from './content-query'
import { contentKeys } from './keys'
@@ -35,7 +35,7 @@ export type ContentIdError = ResponseError
export const useContentIdQuery = <TData = ContentIdData>(
{ projectRef, id }: { projectRef?: string; id?: string },
- { enabled = true, ...options }: UseQueryOptions<ContentIdData, ContentIdError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ContentIdData, ContentIdError, TData> = {}
) =>
useQuery<ContentIdData, ContentIdError, TData>({
queryKey: contentKeys.resource(projectRef, id),
diff --git a/apps/studio/data/content/content-infinite-query.ts b/apps/studio/data/content/content-infinite-query.ts
index 169fb8a578b..87f8ff26df9 100644
--- a/apps/studio/data/content/content-infinite-query.ts
+++ b/apps/studio/data/content/content-infinite-query.ts
@@ -1,6 +1,7 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
+import { UseCustomInfiniteQueryOptions } from 'types'
import { Content, ContentType } from './content-query'
import { contentKeys } from './keys'
@@ -48,7 +49,10 @@ export type ContentError = unknown
export const useContentInfiniteQuery = <TData = ContentData>(
{ projectRef, type, name, limit, sort }: GetContentVariables,
- { enabled = true, ...options }: UseInfiniteQueryOptions<ContentData, ContentError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomInfiniteQueryOptions<ContentData, ContentError, TData> = {}
) => {
return useInfiniteQuery<ContentData, ContentError, TData>({
queryKey: contentKeys.infiniteList(projectRef, { type, name, limit, sort }),
diff --git a/apps/studio/data/content/content-insert-mutation.ts b/apps/studio/data/content/content-insert-mutation.ts
index 31e32de6a45..fcf3c72ccac 100644
--- a/apps/studio/data/content/content-insert-mutation.ts
+++ b/apps/studio/data/content/content-insert-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { Content } from './content-query'
import { contentKeys } from './keys'
@@ -47,7 +47,7 @@ export const useContentInsertMutation = ({
onSuccess,
...options
}: Omit<
- UseMutationOptions<InsertContentData, ResponseError, InsertContentVariables>,
+ UseCustomMutationOptions<InsertContentData, ResponseError, InsertContentVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/content/content-query.ts b/apps/studio/data/content/content-query.ts
index 5ca19b335b7..4ea548a0b60 100644
--- a/apps/studio/data/content/content-query.ts
+++ b/apps/studio/data/content/content-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { Dashboards, LogSqlSnippets, SqlSnippets } from 'types'
+import type { Dashboards, LogSqlSnippets, SqlSnippets, UseCustomQueryOptions } from 'types'
import { contentKeys } from './keys'
export type ContentBase = components['schemas']['GetUserContentResponse']['data'][number]
@@ -59,7 +59,7 @@ export type ContentError = unknown
/** @deprecated Use useContentInfiniteQuery from content-infinite-query instead */
export const useContentQuery = <TData = ContentData>(
{ projectRef, type, name, limit }: GetContentVariables,
- { enabled = true, ...options }: UseQueryOptions<ContentData, ContentError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ContentData, ContentError, TData> = {}
) =>
useQuery<ContentData, ContentError, TData>({
queryKey: contentKeys.list(projectRef, { type, name, limit }),
diff --git a/apps/studio/data/content/content-upsert-mutation.ts b/apps/studio/data/content/content-upsert-mutation.ts
index 3676727c2dd..d57ea090dd0 100644
--- a/apps/studio/data/content/content-upsert-mutation.ts
+++ b/apps/studio/data/content/content-upsert-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { Content } from './content-query'
import { contentKeys } from './keys'
@@ -39,7 +39,7 @@ export const useContentUpsertMutation = ({
invalidateQueriesOnSuccess = true,
...options
}: Omit<
- UseMutationOptions<UpsertContentData, ResponseError, UpsertContentVariables>,
+ UseCustomMutationOptions<UpsertContentData, ResponseError, UpsertContentVariables>,
'mutationFn'
> & {
invalidateQueriesOnSuccess?: boolean
diff --git a/apps/studio/data/content/sql-folder-contents-query.ts b/apps/studio/data/content/sql-folder-contents-query.ts
index 393844df459..e6eb557c539 100644
--- a/apps/studio/data/content/sql-folder-contents-query.ts
+++ b/apps/studio/data/content/sql-folder-contents-query.ts
@@ -1,7 +1,7 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { contentKeys } from './keys'
import { SNIPPET_PAGE_LIMIT } from './sql-folders-query'
@@ -51,7 +51,7 @@ export const useSQLSnippetFolderContentsQuery = <TData = SQLSnippetFolderContent
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<
+ }: UseCustomInfiniteQueryOptions<
SQLSnippetFolderContentsData,
SQLSnippetFolderContentsError,
TData
diff --git a/apps/studio/data/content/sql-folder-create-mutation.ts b/apps/studio/data/content/sql-folder-create-mutation.ts
index a626de9b399..ff604a86e1d 100644
--- a/apps/studio/data/content/sql-folder-create-mutation.ts
+++ b/apps/studio/data/content/sql-folder-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { contentKeys } from './keys'
export type CreateSQLSnippetFolderVariables = {
@@ -36,7 +36,11 @@ export const useSQLSnippetFolderCreateMutation = ({
invalidateQueriesOnSuccess = true,
...options
}: Omit<
- UseMutationOptions<CreateSQLSnippetFolderData, ResponseError, CreateSQLSnippetFolderVariables>,
+ UseCustomMutationOptions<
+ CreateSQLSnippetFolderData,
+ ResponseError,
+ CreateSQLSnippetFolderVariables
+ >,
'mutationFn'
> & {
invalidateQueriesOnSuccess?: boolean
diff --git a/apps/studio/data/content/sql-folder-update-mutation.ts b/apps/studio/data/content/sql-folder-update-mutation.ts
index 4225a2ed9d2..cef8792a03c 100644
--- a/apps/studio/data/content/sql-folder-update-mutation.ts
+++ b/apps/studio/data/content/sql-folder-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { contentKeys } from './keys'
export type UpdateSQLSnippetFolderVariables = {
@@ -37,7 +37,11 @@ export const useSQLSnippetFolderCreateMutation = ({
invalidateQueriesOnSuccess = true,
...options
}: Omit<
- UseMutationOptions<UpdateSQLSnippetFolderData, ResponseError, UpdateSQLSnippetFolderVariables>,
+ UseCustomMutationOptions<
+ UpdateSQLSnippetFolderData,
+ ResponseError,
+ UpdateSQLSnippetFolderVariables
+ >,
'mutationFn'
> & {
invalidateQueriesOnSuccess?: boolean
diff --git a/apps/studio/data/content/sql-folders-delete-mutation.ts b/apps/studio/data/content/sql-folders-delete-mutation.ts
index cee6f915e0e..5b3ff5f5c73 100644
--- a/apps/studio/data/content/sql-folders-delete-mutation.ts
+++ b/apps/studio/data/content/sql-folders-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { contentKeys } from './keys'
export type DeleteSQLSnippetFoldersVariables = {
@@ -32,7 +32,11 @@ export const useSQLSnippetFoldersDeleteMutation = ({
invalidateQueriesOnSuccess = true,
...options
}: Omit<
- UseMutationOptions<DeleteSQLSnippetFoldersData, ResponseError, DeleteSQLSnippetFoldersVariables>,
+ UseCustomMutationOptions<
+ DeleteSQLSnippetFoldersData,
+ ResponseError,
+ DeleteSQLSnippetFoldersVariables
+ >,
'mutationFn'
> & {
invalidateQueriesOnSuccess?: boolean
diff --git a/apps/studio/data/content/sql-folders-query.ts b/apps/studio/data/content/sql-folders-query.ts
index 54749e47d87..e0abb4932c4 100644
--- a/apps/studio/data/content/sql-folders-query.ts
+++ b/apps/studio/data/content/sql-folders-query.ts
@@ -1,8 +1,8 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { contentKeys } from './keys'
export type SnippetFolderResponse = components['schemas']['GetUserContentFolderResponse']['data']
@@ -60,7 +60,7 @@ export const useSQLSnippetFoldersQuery = <TData = SQLSnippetFoldersData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<SQLSnippetFoldersData, SQLSnippetFoldersError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<SQLSnippetFoldersData, SQLSnippetFoldersError, TData> = {}
) =>
useInfiniteQuery<SQLSnippetFoldersData, SQLSnippetFoldersError, TData>({
queryKey: contentKeys.folders(projectRef, { name, sort }),
diff --git a/apps/studio/data/content/sql-snippets-query.ts b/apps/studio/data/content/sql-snippets-query.ts
index d2ea729c5e0..3c941176ac7 100644
--- a/apps/studio/data/content/sql-snippets-query.ts
+++ b/apps/studio/data/content/sql-snippets-query.ts
@@ -1,6 +1,7 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { get } from 'data/fetchers'
+import { UseCustomInfiniteQueryOptions } from 'types'
import { Content } from './content-query'
import { contentKeys } from './keys'
import { SNIPPET_PAGE_LIMIT } from './sql-folders-query'
@@ -61,7 +62,7 @@ export const useSqlSnippetsQuery = <TData = SqlSnippetsData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<SqlSnippetsData, SqlSnippetsError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<SqlSnippetsData, SqlSnippetsError, TData> = {}
) =>
useInfiniteQuery<SqlSnippetsData, SqlSnippetsError, TData>({
queryKey: contentKeys.sqlSnippets(projectRef, { sort, name, visibility, favorite }),
diff --git a/apps/studio/data/custom-domains/check-cname-mutation.ts b/apps/studio/data/custom-domains/check-cname-mutation.ts
index a85afaf0659..c7bfe741ce0 100644
--- a/apps/studio/data/custom-domains/check-cname-mutation.ts
+++ b/apps/studio/data/custom-domains/check-cname-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { fetchHandler, handleError } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type CheckCNAMERecordVariables = {
domain: string
@@ -47,7 +47,7 @@ export const useCheckCNAMERecordMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CheckCNAMERecordData, ResponseError, CheckCNAMERecordVariables>,
+ UseCustomMutationOptions<CheckCNAMERecordData, ResponseError, CheckCNAMERecordVariables>,
'mutationFn'
> = {}) => {
return useMutation<CheckCNAMERecordData, ResponseError, CheckCNAMERecordVariables>({
diff --git a/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts b/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts
index e49c8845ccd..f6b49ef7fd1 100644
--- a/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts
+++ b/apps/studio/data/custom-domains/custom-domains-activate-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { customDomainKeys } from './keys'
export type CustomDomainActivateVariables = {
@@ -25,7 +25,7 @@ export const useCustomDomainActivateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomDomainActivateData, ResponseError, CustomDomainActivateVariables>,
+ UseCustomMutationOptions<CustomDomainActivateData, ResponseError, CustomDomainActivateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/custom-domains/custom-domains-create-mutation.ts b/apps/studio/data/custom-domains/custom-domains-create-mutation.ts
index 6c0f7c69632..e70d671d9ca 100644
--- a/apps/studio/data/custom-domains/custom-domains-create-mutation.ts
+++ b/apps/studio/data/custom-domains/custom-domains-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { customDomainKeys } from './keys'
export type CustomDomainCreateVariables = {
@@ -30,7 +30,7 @@ export const useCustomDomainCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomDomainCreateData, ResponseError, CustomDomainCreateVariables>,
+ UseCustomMutationOptions<CustomDomainCreateData, ResponseError, CustomDomainCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts b/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts
index 8a28cb320a3..8ec84dd46af 100644
--- a/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts
+++ b/apps/studio/data/custom-domains/custom-domains-delete-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import { subscriptionKeys } from 'data/subscriptions/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { customDomainKeys } from './keys'
export type CustomDomainDeleteVariables = {
@@ -28,7 +28,7 @@ export const useCustomDomainDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomDomainDeleteData, ResponseError, CustomDomainDeleteVariables>,
+ UseCustomMutationOptions<CustomDomainDeleteData, ResponseError, CustomDomainDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/custom-domains/custom-domains-query.ts b/apps/studio/data/custom-domains/custom-domains-query.ts
index 8f9e757c280..db502694a7a 100644
--- a/apps/studio/data/custom-domains/custom-domains-query.ts
+++ b/apps/studio/data/custom-domains/custom-domains-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { useProjectAddonsQuery } from 'data/subscriptions/project-addons-query'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { customDomainKeys } from './keys'
export type CustomDomainsVariables = {
@@ -105,7 +105,10 @@ export type CustomDomainsError = ResponseError
export const useCustomDomainsQuery = <TData = CustomDomainsData>(
{ projectRef }: CustomDomainsVariables,
- { enabled = true, ...options }: UseQueryOptions<CustomDomainsData, CustomDomainsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<CustomDomainsData, CustomDomainsError, TData> = {}
) => {
const { data } = useProjectAddonsQuery({ projectRef })
const hasCustomDomainsAddon = !!data?.selected_addons.find((x) => x.type === 'custom_domain')
diff --git a/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts b/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts
index 3ed924f6e15..6e0ccce0602 100644
--- a/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts
+++ b/apps/studio/data/custom-domains/custom-domains-reverify-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { customDomainKeys } from './keys'
export type CustomDomainReverifyVariables = {
@@ -25,7 +25,7 @@ export const useCustomDomainReverifyMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomDomainReverifyData, ResponseError, CustomDomainReverifyVariables>,
+ UseCustomMutationOptions<CustomDomainReverifyData, ResponseError, CustomDomainReverifyVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-columns/database-column-create-mutation.ts b/apps/studio/data/database-columns/database-column-create-mutation.ts
index 19ee9b2ab7d..f19f64bec26 100644
--- a/apps/studio/data/database-columns/database-column-create-mutation.ts
+++ b/apps/studio/data/database-columns/database-column-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type CreateColumnBody = {
schema: string
@@ -65,7 +65,7 @@ export const useDatabaseColumnCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseColumnCreateData, ResponseError, DatabaseColumnCreateVariables>,
+ UseCustomMutationOptions<DatabaseColumnCreateData, ResponseError, DatabaseColumnCreateVariables>,
'mutationFn'
> = {}) => {
return useMutation<DatabaseColumnCreateData, ResponseError, DatabaseColumnCreateVariables>({
diff --git a/apps/studio/data/database-columns/database-column-delete-mutation.ts b/apps/studio/data/database-columns/database-column-delete-mutation.ts
index 1bae6d88ae8..d37fc390f5b 100644
--- a/apps/studio/data/database-columns/database-column-delete-mutation.ts
+++ b/apps/studio/data/database-columns/database-column-delete-mutation.ts
@@ -1,6 +1,6 @@
import pgMeta from '@supabase/pg-meta'
import { PGColumn } from '@supabase/pg-meta/src/pg-meta-columns'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { databaseKeys } from 'data/database/keys'
@@ -9,7 +9,7 @@ import { executeSql } from 'data/sql/execute-sql-query'
import { tableEditorKeys } from 'data/table-editor/keys'
import { tableRowKeys } from 'data/table-rows/keys'
import { viewKeys } from 'data/views/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type DatabaseColumnDeleteVariables = {
projectRef: string
@@ -43,7 +43,7 @@ export const useDatabaseColumnDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseColumnDeleteData, ResponseError, DatabaseColumnDeleteVariables>,
+ UseCustomMutationOptions<DatabaseColumnDeleteData, ResponseError, DatabaseColumnDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-columns/database-column-update-mutation.ts b/apps/studio/data/database-columns/database-column-update-mutation.ts
index 8958473ed60..58eafce8968 100644
--- a/apps/studio/data/database-columns/database-column-update-mutation.ts
+++ b/apps/studio/data/database-columns/database-column-update-mutation.ts
@@ -1,10 +1,10 @@
import pgMeta from '@supabase/pg-meta'
import { PGColumn } from '@supabase/pg-meta/src/pg-meta-columns'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { CreateColumnBody } from './database-column-create-mutation'
export type UpdateColumnBody = Partial<
@@ -67,7 +67,7 @@ export const useDatabaseColumnUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseColumnUpdateData, ResponseError, DatabaseColumnUpdateVariables>,
+ UseCustomMutationOptions<DatabaseColumnUpdateData, ResponseError, DatabaseColumnUpdateVariables>,
'mutationFn'
> = {}) => {
return useMutation<DatabaseColumnUpdateData, ResponseError, DatabaseColumnUpdateVariables>({
diff --git a/apps/studio/data/database-cron-jobs/database-cron-job-query.ts b/apps/studio/data/database-cron-jobs/database-cron-job-query.ts
index 3f35b350671..237b038e82d 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-job-query.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-job-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { CronJob } from './database-cron-jobs-infinite-query'
import { databaseCronJobsKeys } from './keys'
@@ -40,7 +40,7 @@ export const useCronJobQuery = <TData = DatabaseCronJobData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseCronJobData, DatabaseCronJobError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseCronJobData, DatabaseCronJobError, TData> = {}
) =>
useQuery<DatabaseCronJobData, DatabaseCronJobError, TData>({
queryKey: databaseCronJobsKeys.job(projectRef, id ?? name),
diff --git a/apps/studio/data/database-cron-jobs/database-cron-job-run-mutation.ts b/apps/studio/data/database-cron-jobs/database-cron-job-run-mutation.ts
index c4d416dde14..9f5491954b6 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-job-run-mutation.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-job-run-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobRunVariables = {
@@ -44,7 +44,7 @@ export const useDatabaseCronJobRunCommandMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseCronJobRunData, ResponseError, DatabaseCronJobRunVariables>,
+ UseCustomMutationOptions<DatabaseCronJobRunData, ResponseError, DatabaseCronJobRunVariables>,
'mutationFn'
> = {}) => {
return useMutation<DatabaseCronJobRunData, ResponseError, DatabaseCronJobRunVariables>({
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-count-query.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-count-query.ts
index db44923c27b..86f9f4d08cb 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-count-query.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-count-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
type DatabaseCronJobsCountVariables = {
@@ -33,7 +33,7 @@ export const useCronJobsCountQuery = <TData = DatabaseCronJobData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseCronJobData, DatabaseCronJobError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseCronJobData, DatabaseCronJobError, TData> = {}
) =>
useQuery<DatabaseCronJobData, DatabaseCronJobError, TData>({
queryKey: databaseCronJobsKeys.count(projectRef),
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-create-mutation.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-create-mutation.ts
index c191b486090..04d31d6a67f 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-create-mutation.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobCreateVariables = {
@@ -35,7 +35,11 @@ export const useDatabaseCronJobCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseCronJobCreateData, ResponseError, DatabaseCronJobCreateVariables>,
+ UseCustomMutationOptions<
+ DatabaseCronJobCreateData,
+ ResponseError,
+ DatabaseCronJobCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-delete-mutation.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-delete-mutation.ts
index 216984f1430..43f3e8891f3 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-delete-mutation.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobDeleteVariables = {
@@ -34,7 +34,11 @@ export const useDatabaseCronJobDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseCronJobDeleteData, ResponseError, DatabaseCronJobDeleteVariables>,
+ UseCustomMutationOptions<
+ DatabaseCronJobDeleteData,
+ ResponseError,
+ DatabaseCronJobDeleteVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-infinite-query.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-infinite-query.ts
index 81cf7242b3e..bb0e0173438 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-infinite-query.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-infinite-query.ts
@@ -1,7 +1,7 @@
-import { UseInfiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
const CRON_JOBS_PAGE_LIMIT = 20
@@ -87,7 +87,7 @@ export const useCronJobsInfiniteQuery = <TData = DatabaseCronJobsInfiniteData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<
+ }: UseCustomInfiniteQueryOptions<
DatabaseCronJobsInfiniteData,
DatabaseCronJobsInfiniteError,
TData
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-runs-infinite-query.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-runs-infinite-query.ts
index 57e859e2129..cfe071f6106 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-runs-infinite-query.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-runs-infinite-query.ts
@@ -1,8 +1,8 @@
-import { UseInfiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { last } from 'lodash'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobRunsVariables = {
@@ -59,7 +59,7 @@ export const useCronJobRunsInfiniteQuery = <TData = DatabaseCronJobRunData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<DatabaseCronJobRunData, DatabaseCronJobError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<DatabaseCronJobRunData, DatabaseCronJobError, TData> = {}
) =>
useInfiniteQuery<DatabaseCronJobRunData, DatabaseCronJobError, TData>({
queryKey: databaseCronJobsKeys.runsInfinite(projectRef, jobId, { status }),
diff --git a/apps/studio/data/database-cron-jobs/database-cron-jobs-toggle-mutation.ts b/apps/studio/data/database-cron-jobs/database-cron-jobs-toggle-mutation.ts
index 54eba75d8f8..b3884d9853f 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-jobs-toggle-mutation.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-jobs-toggle-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobToggleVariables = {
@@ -36,7 +36,11 @@ export const useDatabaseCronJobToggleMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseCronJobToggleData, ResponseError, DatabaseCronJobToggleVariables>,
+ UseCustomMutationOptions<
+ DatabaseCronJobToggleData,
+ ResponseError,
+ DatabaseCronJobToggleVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-cron-jobs/database-cron-timezone-query.ts b/apps/studio/data/database-cron-jobs/database-cron-timezone-query.ts
index 1ef2e3a99e8..a2da99eacc1 100644
--- a/apps/studio/data/database-cron-jobs/database-cron-timezone-query.ts
+++ b/apps/studio/data/database-cron-jobs/database-cron-timezone-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseCronJobsKeys } from './keys'
export type DatabaseCronJobsVariables = {
@@ -26,7 +26,7 @@ export type DatabaseCronJobError = ResponseError
export const useCronTimezoneQuery = <TData = string>(
{ projectRef, connectionString }: DatabaseCronJobsVariables,
- { enabled = true, ...options }: UseQueryOptions<string, DatabaseCronJobError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<string, DatabaseCronJobError, TData> = {}
) =>
useQuery<string, DatabaseCronJobError, TData>({
queryKey: databaseCronJobsKeys.timezone(projectRef),
diff --git a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts b/apps/studio/data/database-extensions/database-extension-disable-mutation.ts
index db703e7d587..0482da165be 100644
--- a/apps/studio/data/database-extensions/database-extension-disable-mutation.ts
+++ b/apps/studio/data/database-extensions/database-extension-disable-mutation.ts
@@ -1,10 +1,10 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { configKeys } from 'data/config/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseExtensionsKeys } from './keys'
export type DatabaseExtensionDisableVariables = {
@@ -41,7 +41,7 @@ export const useDatabaseExtensionDisableMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseExtensionDisableData,
ResponseError,
DatabaseExtensionDisableVariables
diff --git a/apps/studio/data/database-extensions/database-extension-enable-mutation.ts b/apps/studio/data/database-extensions/database-extension-enable-mutation.ts
index fc993017bf2..256d916aaf3 100644
--- a/apps/studio/data/database-extensions/database-extension-enable-mutation.ts
+++ b/apps/studio/data/database-extensions/database-extension-enable-mutation.ts
@@ -1,11 +1,11 @@
import pgMeta from '@supabase/pg-meta'
import { ident } from '@supabase/pg-meta/src/pg-format'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { configKeys } from 'data/config/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseExtensionsKeys } from './keys'
export type DatabaseExtensionEnableVariables = {
@@ -48,7 +48,11 @@ export const useDatabaseExtensionEnableMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseExtensionEnableData, ResponseError, DatabaseExtensionEnableVariables>,
+ UseCustomMutationOptions<
+ DatabaseExtensionEnableData,
+ ResponseError,
+ DatabaseExtensionEnableVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-extensions/database-extensions-query.ts b/apps/studio/data/database-extensions/database-extensions-query.ts
index 0d4ee6abbd6..0c6f7388d8c 100644
--- a/apps/studio/data/database-extensions/database-extensions-query.ts
+++ b/apps/studio/data/database-extensions/database-extensions-query.ts
@@ -1,10 +1,10 @@
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseExtensionsKeys } from './keys'
export type DatabaseExtension = components['schemas']['PostgresExtension']
@@ -50,7 +50,7 @@ export const useDatabaseExtensionsQuery = <TData = DatabaseExtensionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseExtensionsData, DatabaseExtensionsError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseExtensionsData, DatabaseExtensionsError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/database-functions/database-functions-create-mutation.ts b/apps/studio/data/database-functions/database-functions-create-mutation.ts
index c399935c6ce..06fc71cda19 100644
--- a/apps/studio/data/database-functions/database-functions-create-mutation.ts
+++ b/apps/studio/data/database-functions/database-functions-create-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { z } from 'zod'
import pgMeta from '@supabase/pg-meta'
import { databaseKeys } from 'data/database/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type DatabaseFunctionCreateVariables = {
projectRef: string
@@ -37,7 +37,11 @@ export const useDatabaseFunctionCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseFunctionCreateData, ResponseError, DatabaseFunctionCreateVariables>,
+ UseCustomMutationOptions<
+ DatabaseFunctionCreateData,
+ ResponseError,
+ DatabaseFunctionCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-functions/database-functions-delete-mutation.ts b/apps/studio/data/database-functions/database-functions-delete-mutation.ts
index 2d81c973562..195a38b2a27 100644
--- a/apps/studio/data/database-functions/database-functions-delete-mutation.ts
+++ b/apps/studio/data/database-functions/database-functions-delete-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { z } from 'zod'
import pgMeta from '@supabase/pg-meta'
import { databaseKeys } from 'data/database/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { DatabaseFunction } from './database-functions-query'
export type DatabaseFunctionDeleteVariables = {
@@ -38,7 +38,11 @@ export const useDatabaseFunctionDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseFunctionDeleteData, ResponseError, DatabaseFunctionDeleteVariables>,
+ UseCustomMutationOptions<
+ DatabaseFunctionDeleteData,
+ ResponseError,
+ DatabaseFunctionDeleteVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-functions/database-functions-query.ts b/apps/studio/data/database-functions/database-functions-query.ts
index 5d8cec8a448..ea68e83fe6f 100644
--- a/apps/studio/data/database-functions/database-functions-query.ts
+++ b/apps/studio/data/database-functions/database-functions-query.ts
@@ -1,8 +1,8 @@
import pgMeta from '@supabase/pg-meta'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { databaseKeys } from 'data/database/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { z } from 'zod'
export type DatabaseFunctionsVariables = {
@@ -43,7 +43,7 @@ export const useDatabaseFunctionsQuery = <TData = DatabaseFunctionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseFunctionsData, DatabaseFunctionsError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseFunctionsData, DatabaseFunctionsError, TData> = {}
) =>
useQuery<DatabaseFunctionsData, DatabaseFunctionsError, TData>({
queryKey: databaseKeys.databaseFunctions(projectRef),
diff --git a/apps/studio/data/database-functions/database-functions-update-mutation.ts b/apps/studio/data/database-functions/database-functions-update-mutation.ts
index e8b539f1153..a81c1415a4f 100644
--- a/apps/studio/data/database-functions/database-functions-update-mutation.ts
+++ b/apps/studio/data/database-functions/database-functions-update-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { z } from 'zod'
import pgMeta from '@supabase/pg-meta'
import { databaseKeys } from 'data/database/keys'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { DatabaseFunction } from './database-functions-query'
export type DatabaseFunctionUpdateVariables = {
@@ -40,7 +40,11 @@ export const useDatabaseFunctionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseFunctionUpdateData, ResponseError, DatabaseFunctionUpdateVariables>,
+ UseCustomMutationOptions<
+ DatabaseFunctionUpdateData,
+ ResponseError,
+ DatabaseFunctionUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-indexes/index-create-mutation.ts b/apps/studio/data/database-indexes/index-create-mutation.ts
index 7dc32ef126d..e9159ceaaec 100644
--- a/apps/studio/data/database-indexes/index-create-mutation.ts
+++ b/apps/studio/data/database-indexes/index-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseIndexesKeys } from './keys'
export type DatabaseIndexCreateVariables = {
@@ -46,7 +46,7 @@ export const useDatabaseIndexCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseIndexCreateData, ResponseError, DatabaseIndexCreateVariables>,
+ UseCustomMutationOptions<DatabaseIndexCreateData, ResponseError, DatabaseIndexCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-indexes/index-delete-mutation.ts b/apps/studio/data/database-indexes/index-delete-mutation.ts
index d4f5deea373..989045ffe2a 100644
--- a/apps/studio/data/database-indexes/index-delete-mutation.ts
+++ b/apps/studio/data/database-indexes/index-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseIndexesKeys } from './keys'
export type DatabaseIndexDeleteVariables = {
@@ -37,7 +37,7 @@ export const useDatabaseIndexDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseIndexDeleteData, ResponseError, DatabaseIndexDeleteVariables>,
+ UseCustomMutationOptions<DatabaseIndexDeleteData, ResponseError, DatabaseIndexDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-indexes/indexes-query.ts b/apps/studio/data/database-indexes/indexes-query.ts
index 63c46d52af9..924082e501c 100644
--- a/apps/studio/data/database-indexes/indexes-query.ts
+++ b/apps/studio/data/database-indexes/indexes-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseIndexesKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type GetIndexesArgs = {
schema?: string
@@ -55,7 +56,7 @@ export type IndexesError = ExecuteSqlError
export const useIndexesQuery = <TData = IndexesData>(
{ projectRef, connectionString, schema }: IndexesVariables,
- { enabled = true, ...options }: UseQueryOptions<IndexesData, IndexesError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<IndexesData, IndexesError, TData> = {}
) =>
useQuery<IndexesData, IndexesError, TData>({
queryKey: databaseIndexesKeys.list(projectRef, schema),
diff --git a/apps/studio/data/database-policies/database-policies-query.ts b/apps/studio/data/database-policies/database-policies-query.ts
index 86112fc583d..d635f4fa131 100644
--- a/apps/studio/data/database-policies/database-policies-query.ts
+++ b/apps/studio/data/database-policies/database-policies-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { get, handleError } from 'data/fetchers'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databasePoliciesKeys } from './keys'
export type DatabasePoliciesVariables = {
@@ -51,7 +51,7 @@ export const useDatabasePoliciesQuery = <TData = DatabasePoliciesData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabasePoliciesData, DatabasePoliciesError, TData> = {}
+ }: UseCustomQueryOptions<DatabasePoliciesData, DatabasePoliciesError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/database-policies/database-policy-create-mutation.ts b/apps/studio/data/database-policies/database-policy-create-mutation.ts
index 8fdc5ccb5a5..b1012f086e1 100644
--- a/apps/studio/data/database-policies/database-policy-create-mutation.ts
+++ b/apps/studio/data/database-policies/database-policy-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databasePoliciesKeys } from './keys'
type CreatePolicyBody = {
@@ -49,7 +49,7 @@ export const useDatabasePolicyCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabasePolicyCreateData, ResponseError, DatabasePolicyCreateVariables>,
+ UseCustomMutationOptions<DatabasePolicyCreateData, ResponseError, DatabasePolicyCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-policies/database-policy-delete-mutation.ts b/apps/studio/data/database-policies/database-policy-delete-mutation.ts
index a53ef642a4a..c91a016e836 100644
--- a/apps/studio/data/database-policies/database-policy-delete-mutation.ts
+++ b/apps/studio/data/database-policies/database-policy-delete-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databasePoliciesKeys } from './keys'
export type DatabasePolicyDeleteVariables = {
@@ -43,7 +43,7 @@ export const useDatabasePolicyDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabasePolicyDeleteData, ResponseError, DatabasePolicyDeleteVariables>,
+ UseCustomMutationOptions<DatabasePolicyDeleteData, ResponseError, DatabasePolicyDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-policies/database-policy-update-mutation.ts b/apps/studio/data/database-policies/database-policy-update-mutation.ts
index 33c2e10ab90..790edef1843 100644
--- a/apps/studio/data/database-policies/database-policy-update-mutation.ts
+++ b/apps/studio/data/database-policies/database-policy-update-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databasePoliciesKeys } from './keys'
export type DatabasePolicyUpdateVariables = {
@@ -50,7 +50,7 @@ export const useDatabasePolicyUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabasePolicyUpdateData, ResponseError, DatabasePolicyUpdateVariables>,
+ UseCustomMutationOptions<DatabasePolicyUpdateData, ResponseError, DatabasePolicyUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-publications/database-publications-create-mutation.ts b/apps/studio/data/database-publications/database-publications-create-mutation.ts
index e4579a3b711..9ec3b901272 100644
--- a/apps/studio/data/database-publications/database-publications-create-mutation.ts
+++ b/apps/studio/data/database-publications/database-publications-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databasePublicationsKeys } from './keys'
export type DatabasePublicationCreateVariables = {
@@ -53,7 +53,7 @@ export const useDatabasePublicationCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabasePublicationCreateData,
ResponseError,
DatabasePublicationCreateVariables
diff --git a/apps/studio/data/database-publications/database-publications-query.ts b/apps/studio/data/database-publications/database-publications-query.ts
index 0d889ebab98..cb30108dc87 100644
--- a/apps/studio/data/database-publications/database-publications-query.ts
+++ b/apps/studio/data/database-publications/database-publications-query.ts
@@ -1,8 +1,8 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databasePublicationsKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type DatabasePublicationsVariables = {
projectRef?: string
@@ -44,7 +44,7 @@ export const useDatabasePublicationsQuery = <TData = DatabasePublicationsData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabasePublicationsData, DatabasePublicationsError, TData> = {}
+ }: UseCustomQueryOptions<DatabasePublicationsData, DatabasePublicationsError, TData> = {}
) =>
useQuery<DatabasePublicationsData, DatabasePublicationsError, TData>({
queryKey: databasePublicationsKeys.list(projectRef),
diff --git a/apps/studio/data/database-publications/database-publications-update-mutation.ts b/apps/studio/data/database-publications/database-publications-update-mutation.ts
index f4056d465f3..86d32c2a73e 100644
--- a/apps/studio/data/database-publications/database-publications-update-mutation.ts
+++ b/apps/studio/data/database-publications/database-publications-update-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databasePublicationsKeys } from './keys'
export type DatabasePublicationUpdateVariables = {
@@ -52,7 +52,7 @@ export const useDatabasePublicationUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabasePublicationUpdateData,
ResponseError,
DatabasePublicationUpdateVariables
diff --git a/apps/studio/data/database-queues/database-queue-messages-archive-mutation.ts b/apps/studio/data/database-queues/database-queue-messages-archive-mutation.ts
index ea21e8994a8..5a0ea9600d0 100644
--- a/apps/studio/data/database-queues/database-queue-messages-archive-mutation.ts
+++ b/apps/studio/data/database-queues/database-queue-messages-archive-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueMessageArchiveVariables = {
@@ -35,7 +35,7 @@ export const useDatabaseQueueMessageArchiveMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseQueueMessageArchiveData,
ResponseError,
DatabaseQueueMessageArchiveVariables
diff --git a/apps/studio/data/database-queues/database-queue-messages-delete-mutation.ts b/apps/studio/data/database-queues/database-queue-messages-delete-mutation.ts
index 4aa186bdab8..4c84f5217c7 100644
--- a/apps/studio/data/database-queues/database-queue-messages-delete-mutation.ts
+++ b/apps/studio/data/database-queues/database-queue-messages-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueMessageDeleteVariables = {
@@ -35,7 +35,7 @@ export const useDatabaseQueueMessageDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseQueueMessageDeleteData,
ResponseError,
DatabaseQueueMessageDeleteVariables
diff --git a/apps/studio/data/database-queues/database-queue-messages-infinite-query.ts b/apps/studio/data/database-queues/database-queue-messages-infinite-query.ts
index e43456a8976..caeb64a897e 100644
--- a/apps/studio/data/database-queues/database-queue-messages-infinite-query.ts
+++ b/apps/studio/data/database-queues/database-queue-messages-infinite-query.ts
@@ -1,11 +1,11 @@
-import { UseInfiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import dayjs from 'dayjs'
import { last } from 'lodash'
import { QUEUE_MESSAGE_TYPE } from 'components/interfaces/Integrations/Queues/SingleQueue/Queue.utils'
import { executeSql } from 'data/sql/execute-sql-query'
import { DATE_FORMAT } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueVariables = {
@@ -80,7 +80,7 @@ export const useQueueMessagesInfiniteQuery = <TData = DatabaseQueueData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
) =>
useInfiniteQuery<DatabaseQueueData, DatabaseQueueError, TData>({
queryKey: databaseQueuesKeys.getMessagesInfinite(projectRef, queueName, { status }),
diff --git a/apps/studio/data/database-queues/database-queue-messages-read-mutation.ts b/apps/studio/data/database-queues/database-queue-messages-read-mutation.ts
index b5ba4a1d504..0ee46d7e5d8 100644
--- a/apps/studio/data/database-queues/database-queue-messages-read-mutation.ts
+++ b/apps/studio/data/database-queues/database-queue-messages-read-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueMessageReadVariables = {
@@ -37,7 +37,7 @@ export const useDatabaseQueueMessageReadMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseQueueMessageReadData,
ResponseError,
DatabaseQueueMessageReadVariables
diff --git a/apps/studio/data/database-queues/database-queue-messages-send-mutation.ts b/apps/studio/data/database-queues/database-queue-messages-send-mutation.ts
index de5553dfcd6..51ae5b62191 100644
--- a/apps/studio/data/database-queues/database-queue-messages-send-mutation.ts
+++ b/apps/studio/data/database-queues/database-queue-messages-send-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueMessageSendVariables = {
@@ -37,7 +37,7 @@ export const useDatabaseQueueMessageSendMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseQueueMessageSendData,
ResponseError,
DatabaseQueueMessageSendVariables
diff --git a/apps/studio/data/database-queues/database-queues-create-mutation.ts b/apps/studio/data/database-queues/database-queues-create-mutation.ts
index 4ba580918c7..4a6f2adbe38 100644
--- a/apps/studio/data/database-queues/database-queues-create-mutation.ts
+++ b/apps/studio/data/database-queues/database-queues-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
import { tableKeys } from 'data/tables/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueCreateVariables = {
@@ -52,7 +52,7 @@ export const useDatabaseQueueCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseQueueCreateData, ResponseError, DatabaseQueueCreateVariables>,
+ UseCustomMutationOptions<DatabaseQueueCreateData, ResponseError, DatabaseQueueCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-queues/database-queues-delete-mutation.ts b/apps/studio/data/database-queues/database-queues-delete-mutation.ts
index 23b035aeef2..c619b5cc7ae 100644
--- a/apps/studio/data/database-queues/database-queues-delete-mutation.ts
+++ b/apps/studio/data/database-queues/database-queues-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueDeleteVariables = {
@@ -33,7 +33,7 @@ export const useDatabaseQueueDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseQueueDeleteData, ResponseError, DatabaseQueueDeleteVariables>,
+ UseCustomMutationOptions<DatabaseQueueDeleteData, ResponseError, DatabaseQueueDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-queues/database-queues-expose-postgrest-status-query.ts b/apps/studio/data/database-queues/database-queues-expose-postgrest-status-query.ts
index d1672bd60be..56515efef60 100644
--- a/apps/studio/data/database-queues/database-queues-expose-postgrest-status-query.ts
+++ b/apps/studio/data/database-queues/database-queues-expose-postgrest-status-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import minify from 'pg-minify'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { QUEUES_SCHEMA } from './database-queues-toggle-postgrest-mutation'
import { databaseQueuesKeys } from './keys'
@@ -35,7 +35,10 @@ export type DatabaseQueueError = ResponseError
export const useQueuesExposePostgrestStatusQuery = <TData = DatabaseQueueData>(
{ projectRef, connectionString }: DatabaseQueuesVariables,
- { enabled = true, ...options }: UseQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
) =>
useQuery<DatabaseQueueData, DatabaseQueueError, TData>({
queryKey: databaseQueuesKeys.exposePostgrestStatus(projectRef),
diff --git a/apps/studio/data/database-queues/database-queues-metrics-query.ts b/apps/studio/data/database-queues/database-queues-metrics-query.ts
index 681e86108cc..03ad301e5c5 100644
--- a/apps/studio/data/database-queues/database-queues-metrics-query.ts
+++ b/apps/studio/data/database-queues/database-queues-metrics-query.ts
@@ -1,6 +1,6 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueuesMetricsVariables = {
@@ -77,7 +77,7 @@ export const useQueuesMetricsQuery = <TData = DatabaseQueuesMetricsData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseQueuesMetricsData, DatabaseQueuesMetricsError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseQueuesMetricsData, DatabaseQueuesMetricsError, TData> = {}
) =>
useQuery<DatabaseQueuesMetricsData, DatabaseQueuesMetricsError, TData>({
queryKey: databaseQueuesKeys.metrics(projectRef, queueName),
diff --git a/apps/studio/data/database-queues/database-queues-purge-mutation.ts b/apps/studio/data/database-queues/database-queues-purge-mutation.ts
index 6e084223c25..af2a8fd1ce4 100644
--- a/apps/studio/data/database-queues/database-queues-purge-mutation.ts
+++ b/apps/studio/data/database-queues/database-queues-purge-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueuePurgeVariables = {
@@ -33,7 +33,7 @@ export const useDatabaseQueuePurgeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseQueuePurgeData, ResponseError, DatabaseQueuePurgeVariables>,
+ UseCustomMutationOptions<DatabaseQueuePurgeData, ResponseError, DatabaseQueuePurgeVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-queues/database-queues-query.ts b/apps/studio/data/database-queues/database-queues-query.ts
index c86f33e5c54..80667fd5778 100644
--- a/apps/studio/data/database-queues/database-queues-query.ts
+++ b/apps/studio/data/database-queues/database-queues-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueuesVariables = {
@@ -33,7 +33,10 @@ export type DatabaseQueueError = ResponseError
export const useQueuesQuery = <TData = DatabaseQueueData>(
{ projectRef, connectionString }: DatabaseQueuesVariables,
- { enabled = true, ...options }: UseQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DatabaseQueueData, DatabaseQueueError, TData> = {}
) =>
useQuery<DatabaseQueueData, DatabaseQueueError, TData>({
queryKey: databaseQueuesKeys.list(projectRef),
diff --git a/apps/studio/data/database-queues/database-queues-toggle-postgrest-mutation.ts b/apps/studio/data/database-queues/database-queues-toggle-postgrest-mutation.ts
index 02567e13c47..bd637945550 100644
--- a/apps/studio/data/database-queues/database-queues-toggle-postgrest-mutation.ts
+++ b/apps/studio/data/database-queues/database-queues-toggle-postgrest-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import minify from 'pg-minify'
import { toast } from 'sonner'
import { databaseKeys } from 'data/database/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { isGreaterThanOrEqual } from 'lib/semver'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseQueuesKeys } from './keys'
export type DatabaseQueueExposePostgrestVariables = {
@@ -258,7 +258,7 @@ export const useDatabaseQueueToggleExposeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DatabaseQueueExposePostgrestData,
ResponseError,
DatabaseQueueExposePostgrestVariables
diff --git a/apps/studio/data/database-roles/database-role-create-mutation.ts b/apps/studio/data/database-roles/database-role-create-mutation.ts
index 2b45a6674ac..16dc76ccb48 100644
--- a/apps/studio/data/database-roles/database-role-create-mutation.ts
+++ b/apps/studio/data/database-roles/database-role-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invalidateRolesQuery } from './database-roles-query'
type CreateRoleBody = Parameters<typeof pgMeta.roles.create>[0]
@@ -36,7 +36,7 @@ export const useDatabaseRoleCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseRoleCreateData, ResponseError, DatabaseRoleCreateVariables>,
+ UseCustomMutationOptions<DatabaseRoleCreateData, ResponseError, DatabaseRoleCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-roles/database-role-delete-mutation.ts b/apps/studio/data/database-roles/database-role-delete-mutation.ts
index 2dbc00f29be..7fde28eb9e2 100644
--- a/apps/studio/data/database-roles/database-role-delete-mutation.ts
+++ b/apps/studio/data/database-roles/database-role-delete-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invalidateRolesQuery } from './database-roles-query'
type DropRoleBody = Parameters<typeof pgMeta.roles.remove>[1]
@@ -38,7 +38,7 @@ export const useDatabaseRoleDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseRoleDeleteData, ResponseError, DatabaseRoleDeleteVariables>,
+ UseCustomMutationOptions<DatabaseRoleDeleteData, ResponseError, DatabaseRoleDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-roles/database-role-update-mutation.ts b/apps/studio/data/database-roles/database-role-update-mutation.ts
index a3cadbd917f..75108b95433 100644
--- a/apps/studio/data/database-roles/database-role-update-mutation.ts
+++ b/apps/studio/data/database-roles/database-role-update-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invalidateRolesQuery } from './database-roles-query'
type UpdateRoleBody = Parameters<typeof pgMeta.roles.update>[1]
@@ -38,7 +38,7 @@ export const useDatabaseRoleUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseRoleUpdateData, ResponseError, DatabaseRoleUpdateVariables>,
+ UseCustomMutationOptions<DatabaseRoleUpdateData, ResponseError, DatabaseRoleUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-roles/database-roles-query.ts b/apps/studio/data/database-roles/database-roles-query.ts
index c87a7c47e54..a33181eb0ad 100644
--- a/apps/studio/data/database-roles/database-roles-query.ts
+++ b/apps/studio/data/database-roles/database-roles-query.ts
@@ -1,8 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { z } from 'zod'
import { executeSql, ExecuteSqlError } from 'data/sql/execute-sql-query'
+import { UseCustomQueryOptions } from 'types'
import { databaseRoleKeys } from './keys'
export type DatabaseRolesVariables = {
@@ -31,7 +32,10 @@ export type DatabaseRolesError = ExecuteSqlError
export const useDatabaseRolesQuery = <TData = DatabaseRolesData>(
{ projectRef, connectionString }: DatabaseRolesVariables,
- { enabled = true, ...options }: UseQueryOptions<DatabaseRolesData, DatabaseRolesError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DatabaseRolesData, DatabaseRolesError, TData> = {}
) =>
useQuery<DatabaseRolesData, DatabaseRolesError, TData>({
queryKey: databaseRoleKeys.databaseRoles(projectRef),
diff --git a/apps/studio/data/database-triggers/database-trigger-create-mutation.ts b/apps/studio/data/database-triggers/database-trigger-create-mutation.ts
index d88f44247e1..d0209380568 100644
--- a/apps/studio/data/database-triggers/database-trigger-create-mutation.ts
+++ b/apps/studio/data/database-triggers/database-trigger-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
import { PGTriggerCreate } from '@supabase/pg-meta/src/pg-meta-triggers'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseTriggerKeys } from './keys'
export type DatabaseTriggerCreateVariables = {
@@ -36,7 +36,11 @@ export const useDatabaseTriggerCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseTriggerCreateData, ResponseError, DatabaseTriggerCreateVariables>,
+ UseCustomMutationOptions<
+ DatabaseTriggerCreateData,
+ ResponseError,
+ DatabaseTriggerCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts b/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts
index c949802ca9c..d9ec7dd34b8 100644
--- a/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts
+++ b/apps/studio/data/database-triggers/database-trigger-delete-mutation.ts
@@ -1,8 +1,8 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseTriggerKeys } from './keys'
export type DatabaseTriggerDeleteVariables = {
@@ -40,7 +40,11 @@ export const useDatabaseTriggerDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseTriggerDeleteData, ResponseError, DatabaseTriggerDeleteVariables>,
+ UseCustomMutationOptions<
+ DatabaseTriggerDeleteData,
+ ResponseError,
+ DatabaseTriggerDeleteVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-triggers/database-trigger-update-mutation.ts b/apps/studio/data/database-triggers/database-trigger-update-mutation.ts
index 54340e0dd97..46beecfcf00 100644
--- a/apps/studio/data/database-triggers/database-trigger-update-mutation.ts
+++ b/apps/studio/data/database-triggers/database-trigger-update-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
import { PGTriggerUpdate } from '@supabase/pg-meta/src/pg-meta-triggers'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseTriggerKeys } from './keys'
export type DatabaseTriggerUpdateVariables = {
@@ -43,7 +43,11 @@ export const useDatabaseTriggerUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseTriggerUpdateData, ResponseError, DatabaseTriggerUpdateVariables>,
+ UseCustomMutationOptions<
+ DatabaseTriggerUpdateData,
+ ResponseError,
+ DatabaseTriggerUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts b/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts
index e030be2e119..a71b0425932 100644
--- a/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts
+++ b/apps/studio/data/database-triggers/database-trigger-update-transaction-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { PGTrigger, PGTriggerCreate } from '@supabase/pg-meta/src/pg-meta-triggers'
import { PostgresTrigger } from '@supabase/postgres-meta'
import { executeSql } from 'data/sql/execute-sql-query'
import { quoteLiteral } from 'lib/pg-format'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseTriggerKeys } from './keys'
// [Joshen] Writing this query within FE as the PATCH endpoint from pg-meta only supports updating
@@ -58,7 +58,11 @@ export const useDatabaseTriggerUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabaseTriggerUpdateTxnData, ResponseError, DatabaseTriggerUpdateVariables>,
+ UseCustomMutationOptions<
+ DatabaseTriggerUpdateTxnData,
+ ResponseError,
+ DatabaseTriggerUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database-triggers/database-triggers-query.ts b/apps/studio/data/database-triggers/database-triggers-query.ts
index 4e3c9a60a38..59778901977 100644
--- a/apps/studio/data/database-triggers/database-triggers-query.ts
+++ b/apps/studio/data/database-triggers/database-triggers-query.ts
@@ -1,7 +1,7 @@
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseTriggerKeys } from './keys'
export type DatabaseTriggersVariables = {
@@ -43,7 +43,7 @@ export const useDatabaseHooksQuery = <TData = DatabaseTriggersData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseTriggersData, DatabaseTriggersError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseTriggersData, DatabaseTriggersError, TData> = {}
) =>
useQuery<DatabaseTriggersData, DatabaseTriggersError, TData>({
queryKey: databaseTriggerKeys.list(projectRef),
@@ -65,7 +65,7 @@ export const useDatabaseTriggersQuery = <TData = DatabaseTriggersData>(
{
enabled = true,
...options
- }: UseQueryOptions<DatabaseTriggersData, DatabaseTriggersError, TData> = {}
+ }: UseCustomQueryOptions<DatabaseTriggersData, DatabaseTriggersError, TData> = {}
) =>
useQuery<DatabaseTriggersData, DatabaseTriggersError, TData>({
queryKey: databaseTriggerKeys.list(projectRef),
diff --git a/apps/studio/data/database/backup-download-mutation.ts b/apps/studio/data/database/backup-download-mutation.ts
index 3a1915bf29b..2c1371c0f4e 100644
--- a/apps/studio/data/database/backup-download-mutation.ts
+++ b/apps/studio/data/database/backup-download-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
import { components } from 'api-types'
+import { handleError, post } from 'data/fetchers'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type BackupDownloadVariables = {
ref: string
@@ -28,7 +28,7 @@ export const useBackupDownloadMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BackupDownloadData, ResponseError, BackupDownloadVariables>,
+ UseCustomMutationOptions<BackupDownloadData, ResponseError, BackupDownloadVariables>,
'mutationFn'
> = {}) => {
return useMutation<BackupDownloadData, ResponseError, BackupDownloadVariables>({
diff --git a/apps/studio/data/database/backup-query.ts b/apps/studio/data/database/backup-query.ts
index 4f11dbd2f52..03f2c752460 100644
--- a/apps/studio/data/database/backup-query.ts
+++ b/apps/studio/data/database/backup-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type DownloadableBackupVariables = {
@@ -31,7 +31,7 @@ export const useDownloadableBackupQuery = <TData = DownloadableBackupData>(
{
enabled = true,
...options
- }: UseQueryOptions<DownloadableBackupData, DownloadableBackupError, TData> = {}
+ }: UseCustomQueryOptions<DownloadableBackupData, DownloadableBackupError, TData> = {}
) =>
useQuery<DownloadableBackupData, DownloadableBackupError, TData>({
queryKey: databaseKeys.backups(projectRef),
diff --git a/apps/studio/data/database/backup-restore-mutation.ts b/apps/studio/data/database/backup-restore-mutation.ts
index 142cef57071..95b95c2475b 100644
--- a/apps/studio/data/database/backup-restore-mutation.ts
+++ b/apps/studio/data/database/backup-restore-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type BackupRestoreVariables = {
ref: string
@@ -38,7 +38,7 @@ export const useBackupRestoreMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BackupRestoreData, ResponseError, BackupRestoreVariables>,
+ UseCustomMutationOptions<BackupRestoreData, ResponseError, BackupRestoreVariables>,
'mutationFn'
> = {}) => {
return useMutation<BackupRestoreData, ResponseError, BackupRestoreVariables>({
diff --git a/apps/studio/data/database/backups-query.ts b/apps/studio/data/database/backups-query.ts
index 6767055fd8c..1ab9ad3d076 100644
--- a/apps/studio/data/database/backups-query.ts
+++ b/apps/studio/data/database/backups-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { useIsOrioleDbInAws } from 'hooks/misc/useSelectedProject'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type BackupsVariables = {
@@ -29,7 +29,7 @@ export type BackupsError = ResponseError
export const useBackupsQuery = <TData = BackupsData>(
{ projectRef }: BackupsVariables,
- { enabled = true, ...options }: UseQueryOptions<BackupsData, BackupsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<BackupsData, BackupsError, TData> = {}
) => {
// [Joshen] Check for specifically false to account for project not loaded yet
const isOrioleDbInAws = useIsOrioleDbInAws()
diff --git a/apps/studio/data/database/constraints-query.ts b/apps/studio/data/database/constraints-query.ts
index ae38e710f17..22fc7c249ec 100644
--- a/apps/studio/data/database/constraints-query.ts
+++ b/apps/studio/data/database/constraints-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type GetTableConstraintsVariables = {
id?: number
@@ -75,7 +76,7 @@ export const useTableConstraintsQuery = <TData = TableConstraintsData>(
{
enabled = true,
...options
- }: UseQueryOptions<TableConstraintsData, TableConstraintsError, TData> = {}
+ }: UseCustomQueryOptions<TableConstraintsData, TableConstraintsError, TData> = {}
) =>
useQuery<TableConstraintsData, TableConstraintsError, TData>({
queryKey: databaseKeys.tableConstraints(projectRef, id),
diff --git a/apps/studio/data/database/database-password-reset-mutation.ts b/apps/studio/data/database/database-password-reset-mutation.ts
index 6864c7fa411..9a6238dae02 100644
--- a/apps/studio/data/database/database-password-reset-mutation.ts
+++ b/apps/studio/data/database/database-password-reset-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
import { projectKeys } from 'data/projects/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type DatabasePasswordResetVariables = {
ref: string
@@ -29,7 +29,11 @@ export const useDatabasePasswordResetMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DatabasePasswordResetData, ResponseError, DatabasePasswordResetVariables>,
+ UseCustomMutationOptions<
+ DatabasePasswordResetData,
+ ResponseError,
+ DatabasePasswordResetVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database/database-size-query.ts b/apps/studio/data/database/database-size-query.ts
index 12690c11bb4..e2ac985f56a 100644
--- a/apps/studio/data/database/database-size-query.ts
+++ b/apps/studio/data/database/database-size-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export const getDatabaseSizeSql = () => {
const sql = /* SQL */ `
@@ -44,7 +45,10 @@ export type DatabaseSizeError = ExecuteSqlError
export const useDatabaseSizeQuery = <TData = DatabaseSizeData>(
{ projectRef, connectionString }: DatabaseSizeVariables,
- { enabled = true, ...options }: UseQueryOptions<DatabaseSizeData, DatabaseSizeError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DatabaseSizeData, DatabaseSizeError, TData> = {}
) =>
useQuery<DatabaseSizeData, DatabaseSizeError, TData>({
queryKey: databaseKeys.databaseSize(projectRef),
diff --git a/apps/studio/data/database/enable-physical-backups-mutation.ts b/apps/studio/data/database/enable-physical-backups-mutation.ts
index 2a89ffd12f1..cb82cd9cbd4 100644
--- a/apps/studio/data/database/enable-physical-backups-mutation.ts
+++ b/apps/studio/data/database/enable-physical-backups-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type EnablePhysicalBackupsVariables = {
ref: string
@@ -23,7 +23,7 @@ export const useEnablePhysicalBackupsMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BackupRestoreData, ResponseError, EnablePhysicalBackupsVariables>,
+ UseCustomMutationOptions<BackupRestoreData, ResponseError, EnablePhysicalBackupsVariables>,
'mutationFn'
> = {}) => {
return useMutation<BackupRestoreData, ResponseError, EnablePhysicalBackupsVariables>({
diff --git a/apps/studio/data/database/entity-definitions-query.ts b/apps/studio/data/database/entity-definitions-query.ts
index 49bc48c4ba1..f32f87e3c6b 100644
--- a/apps/studio/data/database/entity-definitions-query.ts
+++ b/apps/studio/data/database/entity-definitions-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { CREATE_PG_GET_TABLEDEF_SQL } from './database-table-definition'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export const getEntityDefinitionsSql = ({
schemas,
@@ -109,7 +110,7 @@ export const useEntityDefinitionsQuery = <TData = EntityDefinitionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<EntityDefinitionsData, EntityDefinitionsError, TData> = {}
+ }: UseCustomQueryOptions<EntityDefinitionsData, EntityDefinitionsError, TData> = {}
) =>
useQuery<EntityDefinitionsData, EntityDefinitionsError, TData>({
queryKey: databaseKeys.entityDefinitions(projectRef, schemas),
diff --git a/apps/studio/data/database/foreign-key-constraints-query.ts b/apps/studio/data/database/foreign-key-constraints-query.ts
index c15a0e762be..8494a43e82e 100644
--- a/apps/studio/data/database/foreign-key-constraints-query.ts
+++ b/apps/studio/data/database/foreign-key-constraints-query.ts
@@ -1,7 +1,8 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type GetForeignKeyConstraintsVariables = {
schema?: string
@@ -132,7 +133,7 @@ export const useForeignKeyConstraintsQuery = <TData = ForeignKeyConstraintsData>
{
enabled = true,
...options
- }: UseQueryOptions<ForeignKeyConstraintsData, ForeignKeyConstraintsError, TData> = {}
+ }: UseCustomQueryOptions<ForeignKeyConstraintsData, ForeignKeyConstraintsError, TData> = {}
) =>
useQuery<ForeignKeyConstraintsData, ForeignKeyConstraintsError, TData>({
queryKey: databaseKeys.foreignKeyConstraints(projectRef, schema),
diff --git a/apps/studio/data/database/hooks-enable-mutation.ts b/apps/studio/data/database/hooks-enable-mutation.ts
index 6a98f02c27e..88b88eacee5 100644
--- a/apps/studio/data/database/hooks-enable-mutation.ts
+++ b/apps/studio/data/database/hooks-enable-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invalidateSchemasQuery } from './schemas-query'
export type HooksEnableVariables = {
@@ -24,7 +24,7 @@ export const useHooksEnableMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<HooksEnableData, ResponseError, HooksEnableVariables>,
+ UseCustomMutationOptions<HooksEnableData, ResponseError, HooksEnableVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database/keywords-query.ts b/apps/studio/data/database/keywords-query.ts
index 28ba8b8d1f9..b2cb3e68af6 100644
--- a/apps/studio/data/database/keywords-query.ts
+++ b/apps/studio/data/database/keywords-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export const getKeywordsSql = () => {
const sql = /* SQL */ `
@@ -34,7 +35,7 @@ export type KeywordsError = ExecuteSqlError
export const useKeywordsQuery = <TData = KeywordsData>(
{ projectRef, connectionString }: KeywordsVariables,
- { enabled = true, ...options }: UseQueryOptions<KeywordsData, KeywordsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<KeywordsData, KeywordsError, TData> = {}
) =>
useQuery<KeywordsData, KeywordsError, TData>({
queryKey: databaseKeys.keywords(projectRef),
diff --git a/apps/studio/data/database/max-connections-query.ts b/apps/studio/data/database/max-connections-query.ts
index 8103c8d5565..bf3a183fce7 100644
--- a/apps/studio/data/database/max-connections-query.ts
+++ b/apps/studio/data/database/max-connections-query.ts
@@ -1,4 +1,5 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { UseCustomQueryOptions } from 'types'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
@@ -39,7 +40,7 @@ export const useMaxConnectionsQuery = <TData = MaxConnectionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<MaxConnectionsData, MaxConnectionsError, TData> = {}
+ }: UseCustomQueryOptions<MaxConnectionsData, MaxConnectionsError, TData> = {}
) =>
useQuery<MaxConnectionsData, MaxConnectionsError, TData>({
queryKey: databaseKeys.maxConnections(projectRef),
diff --git a/apps/studio/data/database/migration-upsert-mutation.ts b/apps/studio/data/database/migration-upsert-mutation.ts
index c132e70f493..a31807138b2 100644
--- a/apps/studio/data/database/migration-upsert-mutation.ts
+++ b/apps/studio/data/database/migration-upsert-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseKeys } from './keys'
export type MigrationUpsertVariables = {
@@ -45,7 +45,7 @@ export const useMigrationUpsertMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<MigrationUpsertData, ResponseError, MigrationUpsertVariables>,
+ UseCustomMutationOptions<MigrationUpsertData, ResponseError, MigrationUpsertVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database/migrations-query.ts b/apps/studio/data/database/migrations-query.ts
index ca47a1296a4..f15f44e8108 100644
--- a/apps/studio/data/database/migrations-query.ts
+++ b/apps/studio/data/database/migrations-query.ts
@@ -1,4 +1,5 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { UseCustomQueryOptions } from 'types'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
@@ -55,7 +56,7 @@ export type MigrationsError = ExecuteSqlError
export const useMigrationsQuery = <TData = MigrationsData>(
{ projectRef, connectionString }: MigrationsVariables,
- { enabled = true, ...options }: UseQueryOptions<MigrationsData, MigrationsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<MigrationsData, MigrationsError, TData> = {}
) =>
useQuery<MigrationsData, MigrationsError, TData>({
queryKey: databaseKeys.migrations(projectRef),
diff --git a/apps/studio/data/database/pgbouncer-config-query.ts b/apps/studio/data/database/pgbouncer-config-query.ts
index 5269d82dda2..924ebd59b7c 100644
--- a/apps/studio/data/database/pgbouncer-config-query.ts
+++ b/apps/studio/data/database/pgbouncer-config-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type PgbouncerConfigVariables = {
@@ -31,7 +31,7 @@ export const usePgbouncerConfigQuery = <TData = PgbouncerConfigData>(
{
enabled = true,
...options
- }: UseQueryOptions<PgbouncerConfigData, PgbouncerConfigError, TData> = {}
+ }: UseCustomQueryOptions<PgbouncerConfigData, PgbouncerConfigError, TData> = {}
) =>
useQuery<PgbouncerConfigData, PgbouncerConfigError, TData>({
queryKey: databaseKeys.pgbouncerConfig(projectRef),
diff --git a/apps/studio/data/database/pgbouncer-config-update-mutation.ts b/apps/studio/data/database/pgbouncer-config-update-mutation.ts
index 4f9d34be8d7..1039aea7623 100644
--- a/apps/studio/data/database/pgbouncer-config-update-mutation.ts
+++ b/apps/studio/data/database/pgbouncer-config-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseKeys } from './keys'
export type PgbouncerConfigurationUpdateVariables = {
@@ -41,7 +41,7 @@ export const usePgbouncerConfigurationUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
PgbouncerConfigurationUpdateData,
ResponseError,
PgbouncerConfigurationUpdateVariables
diff --git a/apps/studio/data/database/pgbouncer-status-query.ts b/apps/studio/data/database/pgbouncer-status-query.ts
index 513ea8816ae..333af72e554 100644
--- a/apps/studio/data/database/pgbouncer-status-query.ts
+++ b/apps/studio/data/database/pgbouncer-status-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type PgbouncerStatusVariables = {
@@ -30,7 +30,7 @@ export const usePgbouncerStatusQuery = <TData = PgbouncerStatusData>(
{
enabled = true,
...options
- }: UseQueryOptions<PgbouncerStatusData, PgbouncerStatusError, TData> = {}
+ }: UseCustomQueryOptions<PgbouncerStatusData, PgbouncerStatusError, TData> = {}
) =>
useQuery<PgbouncerStatusData, PgbouncerStatusError, TData>({
queryKey: databaseKeys.pgbouncerStatus(projectRef),
diff --git a/apps/studio/data/database/pitr-restore-mutation.ts b/apps/studio/data/database/pitr-restore-mutation.ts
index 26c102e77dc..01e152360c5 100644
--- a/apps/studio/data/database/pitr-restore-mutation.ts
+++ b/apps/studio/data/database/pitr-restore-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type PitrRestoreVariables = {
ref: string
@@ -25,7 +25,7 @@ export const usePitrRestoreMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<PitrRestoreData, ResponseError, PitrRestoreVariables>,
+ UseCustomMutationOptions<PitrRestoreData, ResponseError, PitrRestoreVariables>,
'mutationFn'
> = {}) => {
return useMutation<PitrRestoreData, ResponseError, PitrRestoreVariables>({
diff --git a/apps/studio/data/database/primary-keys-exists-query.ts b/apps/studio/data/database/primary-keys-exists-query.ts
index 3074b364646..fb3091d0a76 100644
--- a/apps/studio/data/database/primary-keys-exists-query.ts
+++ b/apps/studio/data/database/primary-keys-exists-query.ts
@@ -1,8 +1,8 @@
import { getCheckPrimaryKeysExistsSQL } from '@supabase/pg-meta/src/sql/studio/check-primary-keys-exists'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
type CheckPrimaryKeysExistsVariables = {
@@ -44,7 +44,7 @@ export const useCheckPrimaryKeysExists = <TData = CheckPrimaryKeysExistsData>(
{
enabled = true,
...options
- }: UseQueryOptions<CheckPrimaryKeysExistsData, CheckPrimaryKeysExistsError, TData> = {}
+ }: UseCustomQueryOptions<CheckPrimaryKeysExistsData, CheckPrimaryKeysExistsError, TData> = {}
) =>
useQuery<CheckPrimaryKeysExistsData, CheckPrimaryKeysExistsError, TData>({
queryKey: databaseKeys.checkPrimaryKeysExists(projectRef, tables),
diff --git a/apps/studio/data/database/retrieve-index-advisor-result-query.ts b/apps/studio/data/database/retrieve-index-advisor-result-query.ts
index fcb97c9b032..0f6d9f0b888 100644
--- a/apps/studio/data/database/retrieve-index-advisor-result-query.ts
+++ b/apps/studio/data/database/retrieve-index-advisor-result-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type GetIndexAdvisorResultVariables = {
@@ -45,7 +45,7 @@ export const useGetIndexAdvisorResult = <TData = GetIndexAdvisorResultData>(
{
enabled = true,
...options
- }: UseQueryOptions<GetIndexAdvisorResultData, GetIndexAdvisorResultError, TData> = {}
+ }: UseCustomQueryOptions<GetIndexAdvisorResultData, GetIndexAdvisorResultError, TData> = {}
) =>
useQuery<GetIndexAdvisorResultData, GetIndexAdvisorResultError, TData>({
queryKey: databaseKeys.indexAdvisorFromQuery(projectRef, query),
diff --git a/apps/studio/data/database/retrieve-index-from-select-query.ts b/apps/studio/data/database/retrieve-index-from-select-query.ts
index 493571532e8..a1002b542ae 100644
--- a/apps/studio/data/database/retrieve-index-from-select-query.ts
+++ b/apps/studio/data/database/retrieve-index-from-select-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type GetInvolvedIndexesFromSelectQueryVariables = {
@@ -132,7 +132,7 @@ export const useGetIndexesFromSelectQuery = <TData = GetInvolvedIndexesFromSelec
{
enabled = true,
...options
- }: UseQueryOptions<
+ }: UseCustomQueryOptions<
GetInvolvedIndexesFromSelectQueryData,
GetInvolvedIndexesFromSelectQueryError,
TData
diff --git a/apps/studio/data/database/schema-create-mutation.ts b/apps/studio/data/database/schema-create-mutation.ts
index 258956504dc..42e54d4d24f 100644
--- a/apps/studio/data/database/schema-create-mutation.ts
+++ b/apps/studio/data/database/schema-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invalidateSchemasQuery } from './schemas-query'
export type SchemaCreateVariables = {
@@ -30,7 +30,7 @@ export const useSchemaCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SchemaCreateData, ResponseError, SchemaCreateVariables>,
+ UseCustomMutationOptions<SchemaCreateData, ResponseError, SchemaCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/database/schemas-query.ts b/apps/studio/data/database/schemas-query.ts
index 0295f93c0e0..a51b7905d66 100644
--- a/apps/studio/data/database/schemas-query.ts
+++ b/apps/studio/data/database/schemas-query.ts
@@ -1,8 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { z } from 'zod'
import { executeSql, ExecuteSqlError } from 'data/sql/execute-sql-query'
+import { UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
export type SchemasVariables = {
@@ -36,7 +37,7 @@ export async function getSchemas(
export const useSchemasQuery = <TData = SchemasData>(
{ projectRef, connectionString }: SchemasVariables,
- { enabled = true, ...options }: UseQueryOptions<SchemasData, SchemasError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<SchemasData, SchemasError, TData> = {}
) =>
useQuery<SchemasData, SchemasError, TData>({
queryKey: databaseKeys.schemas(projectRef),
diff --git a/apps/studio/data/database/supavisor-configuration-query.ts b/apps/studio/data/database/supavisor-configuration-query.ts
index 599630d5875..1abc99260b5 100644
--- a/apps/studio/data/database/supavisor-configuration-query.ts
+++ b/apps/studio/data/database/supavisor-configuration-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { databaseKeys } from './keys'
type SupavisorConfigurationVariables = {
@@ -31,7 +31,7 @@ export const useSupavisorConfigurationQuery = <TData = SupavisorConfigurationDat
{
enabled = true,
...options
- }: UseQueryOptions<SupavisorConfigurationData, SupavisorConfigurationError, TData> = {}
+ }: UseCustomQueryOptions<SupavisorConfigurationData, SupavisorConfigurationError, TData> = {}
) =>
useQuery<SupavisorConfigurationData, SupavisorConfigurationError, TData>({
queryKey: databaseKeys.poolingConfiguration(projectRef),
diff --git a/apps/studio/data/database/supavisor-configuration-update-mutation.ts b/apps/studio/data/database/supavisor-configuration-update-mutation.ts
index 54c6bc21f68..6bc4a37d921 100644
--- a/apps/studio/data/database/supavisor-configuration-update-mutation.ts
+++ b/apps/studio/data/database/supavisor-configuration-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { databaseKeys } from './keys'
type SupavisorConfigurationUpdateVariables = {
@@ -32,7 +32,7 @@ export const useSupavisorConfigurationUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
SupavisorConfigurationUpdateData,
ResponseError,
SupavisorConfigurationUpdateVariables
diff --git a/apps/studio/data/database/table-columns-query.ts b/apps/studio/data/database/table-columns-query.ts
index 45b72804d68..fbd23edcded 100644
--- a/apps/studio/data/database/table-columns-query.ts
+++ b/apps/studio/data/database/table-columns-query.ts
@@ -1,4 +1,5 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { UseCustomQueryOptions } from 'types'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
@@ -111,7 +112,10 @@ export type TableColumnsError = ExecuteSqlError
export const useTableColumnsQuery = <TData = TableColumnsData>(
{ projectRef, connectionString, schema, table }: TableColumnsVariables,
- { enabled = true, ...options }: UseQueryOptions<TableColumnsData, TableColumnsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<TableColumnsData, TableColumnsError, TData> = {}
) =>
useQuery<TableColumnsData, TableColumnsError, TData>({
queryKey: databaseKeys.tableColumns(projectRef, schema, table),
diff --git a/apps/studio/data/database/table-definition-query.ts b/apps/studio/data/database/table-definition-query.ts
index b20a20f163b..4d0aaa6ab9d 100644
--- a/apps/studio/data/database/table-definition-query.ts
+++ b/apps/studio/data/database/table-definition-query.ts
@@ -1,4 +1,5 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { UseCustomQueryOptions } from 'types'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { CREATE_PG_GET_TABLEDEF_SQL } from './database-table-definition'
import { databaseKeys } from './keys'
@@ -68,7 +69,7 @@ export const useTableDefinitionQuery = <TData = TableDefinitionData>(
{
enabled = true,
...options
- }: UseQueryOptions<TableDefinitionData, TableDefinitionError, TData> = {}
+ }: UseCustomQueryOptions<TableDefinitionData, TableDefinitionError, TData> = {}
) =>
useQuery<TableDefinitionData, TableDefinitionError, TData>({
queryKey: databaseKeys.tableDefinition(projectRef, id),
diff --git a/apps/studio/data/database/view-definition-query.ts b/apps/studio/data/database/view-definition-query.ts
index fbd2f1b3cd2..411a7204825 100644
--- a/apps/studio/data/database/view-definition-query.ts
+++ b/apps/studio/data/database/view-definition-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { databaseKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type GetViewDefinitionArgs = {
id?: number
@@ -60,7 +61,7 @@ export const useViewDefinitionQuery = <TData = ViewDefinitionData>(
{
enabled = true,
...options
- }: UseQueryOptions<ViewDefinitionData, ViewDefinitionError, TData> = {}
+ }: UseCustomQueryOptions<ViewDefinitionData, ViewDefinitionError, TData> = {}
) =>
useQuery<ViewDefinitionData, ViewDefinitionError, TData>({
queryKey: databaseKeys.viewDefinition(projectRef, id),
diff --git a/apps/studio/data/docs/project-json-schema-query.ts b/apps/studio/data/docs/project-json-schema-query.ts
index cf828c88773..2ce3513a61d 100644
--- a/apps/studio/data/docs/project-json-schema-query.ts
+++ b/apps/studio/data/docs/project-json-schema-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { docsKeys } from './keys'
export type ProjectJsonSchemaVariables = {
@@ -93,7 +93,7 @@ export const useProjectJsonSchemaQuery = <TData = ProjectJsonSchemaData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectJsonSchemaData, ProjectJsonSchemaError, TData> = {}
+ }: UseCustomQueryOptions<ProjectJsonSchemaData, ProjectJsonSchemaError, TData> = {}
) =>
useQuery<ProjectJsonSchemaData, ProjectJsonSchemaError, TData>({
queryKey: docsKeys.jsonSchema(projectRef),
diff --git a/apps/studio/data/documents/document-query.ts b/apps/studio/data/documents/document-query.ts
index c10fa93b852..1e3edd66be9 100644
--- a/apps/studio/data/documents/document-query.ts
+++ b/apps/studio/data/documents/document-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { documentKeys } from './keys'
export type DocType = 'standard-security-questionnaire' | 'soc2-type-2-report'
@@ -45,7 +45,7 @@ export type DocumentError = ResponseError
export const useDocumentQuery = <TData = DocumentData>(
{ orgSlug, docType }: DocumentVariables,
- { enabled = true, ...options }: UseQueryOptions<DocumentData, DocumentError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<DocumentData, DocumentError, TData> = {}
) =>
useQuery<DocumentData, DocumentError, TData>({
queryKey: documentKeys.resource(orgSlug, docType),
diff --git a/apps/studio/data/documents/dpa-request-mutation.ts b/apps/studio/data/documents/dpa-request-mutation.ts
index 1137a6b6bc3..6c732f02f9c 100644
--- a/apps/studio/data/documents/dpa-request-mutation.ts
+++ b/apps/studio/data/documents/dpa-request-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { post, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import { handleError, post } from 'data/fetchers'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type DpaRequestVariables = {
recipient_email: string
@@ -25,7 +25,7 @@ export const useDpaRequestMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DpaRequestData, ResponseError, DpaRequestVariables>,
+ UseCustomMutationOptions<DpaRequestData, ResponseError, DpaRequestVariables>,
'mutationFn'
> = {}) => {
return useMutation<DpaRequestData, ResponseError, DpaRequestVariables>({
diff --git a/apps/studio/data/edge-functions/edge-function-body-query.ts b/apps/studio/data/edge-functions/edge-function-body-query.ts
index 5f7f7923a10..295366c3dad 100644
--- a/apps/studio/data/edge-functions/edge-function-body-query.ts
+++ b/apps/studio/data/edge-functions/edge-function-body-query.ts
@@ -1,8 +1,8 @@
import { getMultipartBoundary, parseMultipartStream } from '@mjackson/multipart-parser'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionBodyVariables = {
@@ -81,7 +81,7 @@ export const useEdgeFunctionBodyQuery = <TData = EdgeFunctionBodyData>(
{
enabled = true,
...options
- }: UseQueryOptions<EdgeFunctionBodyData, EdgeFunctionBodyError, TData> = {}
+ }: UseCustomQueryOptions<EdgeFunctionBodyData, EdgeFunctionBodyError, TData> = {}
) =>
useQuery<EdgeFunctionBodyData, EdgeFunctionBodyError, TData>({
queryKey: edgeFunctionsKeys.body(projectRef, slug),
diff --git a/apps/studio/data/edge-functions/edge-function-query.ts b/apps/studio/data/edge-functions/edge-function-query.ts
index c0aa1ff013d..a44cb9d04e5 100644
--- a/apps/studio/data/edge-functions/edge-function-query.ts
+++ b/apps/studio/data/edge-functions/edge-function-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionVariables = {
@@ -33,7 +33,10 @@ export type EdgeFunctionError = ResponseError
export const useEdgeFunctionQuery = <TData = EdgeFunctionData>(
{ projectRef, slug }: EdgeFunctionVariables,
- { enabled = true, ...options }: UseQueryOptions<EdgeFunctionData, EdgeFunctionError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<EdgeFunctionData, EdgeFunctionError, TData> = {}
) =>
useQuery<EdgeFunctionData, EdgeFunctionError, TData>({
queryKey: edgeFunctionsKeys.detail(projectRef, slug),
diff --git a/apps/studio/data/edge-functions/edge-function-test-mutation.ts b/apps/studio/data/edge-functions/edge-function-test-mutation.ts
index 5c9ec39c5d8..ee80a79721a 100644
--- a/apps/studio/data/edge-functions/edge-function-test-mutation.ts
+++ b/apps/studio/data/edge-functions/edge-function-test-mutation.ts
@@ -1,10 +1,10 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { ResponseData } from 'components/interfaces/Functions/EdgeFunctionDetails/EdgeFunctionDetails.types'
import { constructHeaders, fetchHandler } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type EdgeFunctionTestResponse = {
title: string
@@ -49,7 +49,7 @@ export const useEdgeFunctionTestMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EdgeFunctionTestData, ResponseError, EdgeFunctionTestVariables>,
+ UseCustomMutationOptions<EdgeFunctionTestData, ResponseError, EdgeFunctionTestVariables>,
'mutationFn'
> = {}) => {
return useMutation<EdgeFunctionTestData, ResponseError, EdgeFunctionTestVariables>({
diff --git a/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts b/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts
index d001a37e31b..d446d150b97 100644
--- a/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts
+++ b/apps/studio/data/edge-functions/edge-functions-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionsDeleteVariables = {
@@ -30,7 +30,7 @@ export const useEdgeFunctionDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EdgeFunctionsDeleteData, ResponseError, EdgeFunctionsDeleteVariables>,
+ UseCustomMutationOptions<EdgeFunctionsDeleteData, ResponseError, EdgeFunctionsDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/edge-functions/edge-functions-deploy-mutation.ts b/apps/studio/data/edge-functions/edge-functions-deploy-mutation.ts
index b0cf2aae2ac..8dcff2fbc02 100644
--- a/apps/studio/data/edge-functions/edge-functions-deploy-mutation.ts
+++ b/apps/studio/data/edge-functions/edge-functions-deploy-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionsDeployVariables = {
@@ -53,7 +53,7 @@ export const useEdgeFunctionDeployMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EdgeFunctionsDeployData, ResponseError, EdgeFunctionsDeployVariables>,
+ UseCustomMutationOptions<EdgeFunctionsDeployData, ResponseError, EdgeFunctionsDeployVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/edge-functions/edge-functions-query.ts b/apps/studio/data/edge-functions/edge-functions-query.ts
index 4b872cf0209..798f3374763 100644
--- a/apps/studio/data/edge-functions/edge-functions-query.ts
+++ b/apps/studio/data/edge-functions/edge-functions-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionsVariables = { projectRef?: string }
@@ -29,7 +29,10 @@ export type EdgeFunctionsError = ResponseError
export const useEdgeFunctionsQuery = <TData = EdgeFunctionsData>(
{ projectRef }: EdgeFunctionsVariables,
- { enabled = true, ...options }: UseQueryOptions<EdgeFunctionsData, EdgeFunctionsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<EdgeFunctionsData, EdgeFunctionsError, TData> = {}
) =>
useQuery<EdgeFunctionsData, EdgeFunctionsError, TData>({
queryKey: edgeFunctionsKeys.list(projectRef),
diff --git a/apps/studio/data/edge-functions/edge-functions-update-mutation.ts b/apps/studio/data/edge-functions/edge-functions-update-mutation.ts
index 57e76d11b43..230f0d7dd8f 100644
--- a/apps/studio/data/edge-functions/edge-functions-update-mutation.ts
+++ b/apps/studio/data/edge-functions/edge-functions-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { edgeFunctionsKeys } from './keys'
export type EdgeFunctionsUpdateVariables = {
projectRef: string
@@ -39,7 +39,7 @@ export const useEdgeFunctionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EdgeFunctionsUpdateData, ResponseError, EdgeFunctionsUpdateVariables>,
+ UseCustomMutationOptions<EdgeFunctionsUpdateData, ResponseError, EdgeFunctionsUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/entitlements/entitlements-query.ts b/apps/studio/data/entitlements/entitlements-query.ts
index 991539c6571..40099d85bbf 100644
--- a/apps/studio/data/entitlements/entitlements-query.ts
+++ b/apps/studio/data/entitlements/entitlements-query.ts
@@ -1,8 +1,9 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
-import { get, handleError } from 'data/fetchers'
-import { ResponseError } from 'types/base'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'api-types'
+import { get, handleError } from 'data/fetchers'
import { organizationKeys } from 'data/organizations/keys'
+import { UseCustomQueryOptions } from 'types'
+import { ResponseError } from 'types/base'
export type EntitlementsVariables = {
slug: string
@@ -30,7 +31,10 @@ export type EntitlementsError = ResponseError
export const useEntitlementsQuery = <TData = EntitlementsData>(
{ slug }: EntitlementsVariables,
- { enabled = true, ...options }: UseQueryOptions<EntitlementsData, EntitlementsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<EntitlementsData, EntitlementsError, TData> = {}
) => {
return useQuery<EntitlementsData, EntitlementsError, TData>({
queryKey: [organizationKeys.entitlements(slug)],
diff --git a/apps/studio/data/entity-types/entity-types-infinite-query.ts b/apps/studio/data/entity-types/entity-types-infinite-query.ts
index 72fc8ac4fe0..12ec54dc866 100644
--- a/apps/studio/data/entity-types/entity-types-infinite-query.ts
+++ b/apps/studio/data/entity-types/entity-types-infinite-query.ts
@@ -1,6 +1,6 @@
-import { QueryClient, useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useInfiniteQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlVariables } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { ENTITY_TYPE } from './entity-type-constants'
import { entityTypeKeys } from './keys'
@@ -130,7 +130,7 @@ export const useEntityTypesQuery = <TData = EntityTypesData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<EntityTypesData, EntityTypesError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<EntityTypesData, EntityTypesError, TData> = {}
) => {
return useInfiniteQuery<EntityTypesData, EntityTypesError, TData>({
queryKey: entityTypeKeys.list(projectRef, { schemas, search, sort, limit, filterTypes }),
diff --git a/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts
index bd468194945..9de89157cb1 100644
--- a/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts
+++ b/apps/studio/data/enumerated-types/enumerated-type-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { enumeratedTypesKeys } from './keys'
export type EnumeratedTypeCreateVariables = {
@@ -40,7 +40,7 @@ export const useEnumeratedTypeCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EnumeratedTypeCreateData, ResponseError, EnumeratedTypeCreateVariables>,
+ UseCustomMutationOptions<EnumeratedTypeCreateData, ResponseError, EnumeratedTypeCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts
index 12514e2391b..0a867bcec9b 100644
--- a/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts
+++ b/apps/studio/data/enumerated-types/enumerated-type-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { enumeratedTypesKeys } from './keys'
export type EnumeratedTypeDeleteVariables = {
@@ -30,7 +30,7 @@ export const useEnumeratedTypeDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EnumeratedTypeDeleteData, ResponseError, EnumeratedTypeDeleteVariables>,
+ UseCustomMutationOptions<EnumeratedTypeDeleteData, ResponseError, EnumeratedTypeDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts b/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts
index d8fb085ecaf..aa220bc5360 100644
--- a/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts
+++ b/apps/studio/data/enumerated-types/enumerated-type-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { enumeratedTypesKeys } from './keys'
export type EnumeratedTypeUpdateVariables = {
@@ -66,7 +66,7 @@ export const useEnumeratedTypeUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EnumeratedTypeUpdateData, ResponseError, EnumeratedTypeUpdateVariables>,
+ UseCustomMutationOptions<EnumeratedTypeUpdateData, ResponseError, EnumeratedTypeUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/enumerated-types/enumerated-types-query.ts b/apps/studio/data/enumerated-types/enumerated-types-query.ts
index 6253eef547e..f7aff0c7035 100644
--- a/apps/studio/data/enumerated-types/enumerated-types-query.ts
+++ b/apps/studio/data/enumerated-types/enumerated-types-query.ts
@@ -1,10 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { enumeratedTypesKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type EnumeratedTypesVariables = {
projectRef?: string
@@ -46,7 +46,7 @@ export const useEnumeratedTypesQuery = <TData = EnumeratedTypesData>(
{
enabled = true,
...options
- }: UseQueryOptions<EnumeratedTypesData, EnumeratedTypesError, TData> = {}
+ }: UseCustomQueryOptions<EnumeratedTypesData, EnumeratedTypesError, TData> = {}
) =>
useQuery<EnumeratedTypesData, EnumeratedTypesError, TData>({
queryKey: enumeratedTypesKeys.list(projectRef),
diff --git a/apps/studio/data/fdw/fdw-create-mutation.ts b/apps/studio/data/fdw/fdw-create-mutation.ts
index 8c366b30cb4..581983c99b0 100644
--- a/apps/studio/data/fdw/fdw-create-mutation.ts
+++ b/apps/studio/data/fdw/fdw-create-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import {
@@ -10,7 +10,7 @@ import { foreignTableKeys } from 'data/foreign-tables/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
import { vaultSecretsKeys } from 'data/vault/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { fdwKeys } from './keys'
export type FDWCreateVariables = {
@@ -242,7 +242,7 @@ export const useFDWCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<FDWCreateData, ResponseError, FDWCreateVariables>,
+ UseCustomMutationOptions<FDWCreateData, ResponseError, FDWCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/fdw/fdw-delete-mutation.ts b/apps/studio/data/fdw/fdw-delete-mutation.ts
index 3f3a73fbd51..14c729fdfc8 100644
--- a/apps/studio/data/fdw/fdw-delete-mutation.ts
+++ b/apps/studio/data/fdw/fdw-delete-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { WrapperMeta } from 'components/interfaces/Integrations/Wrappers/Wrappers.types'
@@ -7,7 +7,7 @@ import { foreignTableKeys } from 'data/foreign-tables/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
import { vaultSecretsKeys } from 'data/vault/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { FDW } from './fdws-query'
import { fdwKeys } from './keys'
@@ -99,7 +99,7 @@ export const useFDWDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<FDWDeleteData, ResponseError, FDWDeleteVariables>,
+ UseCustomMutationOptions<FDWDeleteData, ResponseError, FDWDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/fdw/fdw-import-foreign-schema-mutation.ts b/apps/studio/data/fdw/fdw-import-foreign-schema-mutation.ts
index 1667e2b41a0..603426a7283 100644
--- a/apps/studio/data/fdw/fdw-import-foreign-schema-mutation.ts
+++ b/apps/studio/data/fdw/fdw-import-foreign-schema-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { entityTypeKeys } from 'data/entity-types/keys'
@@ -6,7 +6,7 @@ import { foreignTableKeys } from 'data/foreign-tables/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
import { vaultSecretsKeys } from 'data/vault/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { fdwKeys } from './keys'
export type FDWImportForeignSchemaVariables = {
@@ -45,7 +45,7 @@ export const useFDWImportForeignSchemaMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ImportForeignSchemaData, ResponseError, FDWImportForeignSchemaVariables>,
+ UseCustomMutationOptions<ImportForeignSchemaData, ResponseError, FDWImportForeignSchemaVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/fdw/fdw-update-mutation.ts b/apps/studio/data/fdw/fdw-update-mutation.ts
index c4ac3307e2b..df84fe0ee46 100644
--- a/apps/studio/data/fdw/fdw-update-mutation.ts
+++ b/apps/studio/data/fdw/fdw-update-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { WrapperMeta } from 'components/interfaces/Integrations/Wrappers/Wrappers.types'
@@ -7,7 +7,7 @@ import { foreignTableKeys } from 'data/foreign-tables/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { wrapWithTransaction } from 'data/sql/utils/transaction'
import { vaultSecretsKeys } from 'data/vault/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { getCreateFDWSql } from './fdw-create-mutation'
import { getDeleteFDWSql } from './fdw-delete-mutation'
import { FDW } from './fdws-query'
@@ -69,7 +69,7 @@ export const useFDWUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<FDWUpdateData, ResponseError, FDWUpdateVariables>,
+ UseCustomMutationOptions<FDWUpdateData, ResponseError, FDWUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/fdw/fdws-query.ts b/apps/studio/data/fdw/fdws-query.ts
index da74ba15bec..33a8b426fe0 100644
--- a/apps/studio/data/fdw/fdws-query.ts
+++ b/apps/studio/data/fdw/fdws-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { fdwKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export const getFDWsSql = () => {
const sql = /* SQL */ `
@@ -87,7 +88,7 @@ export type FDWsError = ExecuteSqlError
export const useFDWsQuery = <TData = FDWsData>(
{ projectRef, connectionString }: FDWsVariables,
- { enabled = true, ...options }: UseQueryOptions<FDWsData, FDWsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<FDWsData, FDWsError, TData> = {}
) =>
useQuery<FDWsData, FDWsError, TData>({
queryKey: fdwKeys.list(projectRef),
diff --git a/apps/studio/data/feedback/exit-survey-send.ts b/apps/studio/data/feedback/exit-survey-send.ts
index cfc9f884b1b..7910ae26f56 100644
--- a/apps/studio/data/feedback/exit-survey-send.ts
+++ b/apps/studio/data/feedback/exit-survey-send.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type SendDowngradeFeedbackVariables = {
projectRef?: string
@@ -38,7 +38,11 @@ export const useSendDowngradeFeedbackMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SendDowngradeFeedbackData, ResponseError, SendDowngradeFeedbackVariables>,
+ UseCustomMutationOptions<
+ SendDowngradeFeedbackData,
+ ResponseError,
+ SendDowngradeFeedbackVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<SendDowngradeFeedbackData, ResponseError, SendDowngradeFeedbackVariables>({
diff --git a/apps/studio/data/feedback/feedback-category.ts b/apps/studio/data/feedback/feedback-category.ts
index d683fc6eb03..f0c4c2c6e3c 100644
--- a/apps/studio/data/feedback/feedback-category.ts
+++ b/apps/studio/data/feedback/feedback-category.ts
@@ -1,6 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { constructHeaders, fetchHandler, handleError } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
+import { UseCustomQueryOptions } from 'types'
export type FeedbackCategoryVariables = {
prompt: string
@@ -47,7 +48,7 @@ export const useFeedbackCategoryQuery = <TData = FeedbackCategory>(
{
enabled = true,
...options
- }: UseQueryOptions<FeedbackCategory, FeedbackCategoryError, TData> = {}
+ }: UseCustomQueryOptions<FeedbackCategory, FeedbackCategoryError, TData> = {}
) =>
useQuery<FeedbackCategory, FeedbackCategoryError, TData>({
queryKey: ['feedback-category', prompt],
diff --git a/apps/studio/data/feedback/feedback-send.ts b/apps/studio/data/feedback/feedback-send.ts
index ede0f7c1423..68463c9da8b 100644
--- a/apps/studio/data/feedback/feedback-send.ts
+++ b/apps/studio/data/feedback/feedback-send.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type SendFeedbackVariables = {
message: string
@@ -37,7 +37,7 @@ export const useSendFeedbackMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SendFeedbackData, ResponseError, SendFeedbackVariables>,
+ UseCustomMutationOptions<SendFeedbackData, ResponseError, SendFeedbackVariables>,
'mutationFn'
> = {}) => {
return useMutation<SendFeedbackData, ResponseError, SendFeedbackVariables>({
diff --git a/apps/studio/data/feedback/support-ticket-send.ts b/apps/studio/data/feedback/support-ticket-send.ts
index 24a44f7f3d1..91ce4b2f932 100644
--- a/apps/studio/data/feedback/support-ticket-send.ts
+++ b/apps/studio/data/feedback/support-ticket-send.ts
@@ -1,10 +1,10 @@
-import { type UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
// End of third-party imports
import type { ExtendedSupportCategories } from 'components/interfaces/Support/Support.constants'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type sendSupportTicketVariables = {
subject: string
@@ -77,7 +77,7 @@ export const useSendSupportTicketMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<sendSupportTicketData, ResponseError, sendSupportTicketVariables>,
+ UseCustomMutationOptions<sendSupportTicketData, ResponseError, sendSupportTicketVariables>,
'mutationFn'
> = {}) => {
return useMutation<sendSupportTicketData, ResponseError, sendSupportTicketVariables>({
diff --git a/apps/studio/data/feedback/upgrade-survey-send.ts b/apps/studio/data/feedback/upgrade-survey-send.ts
index e87aff4bfc1..09e70bf4f7e 100644
--- a/apps/studio/data/feedback/upgrade-survey-send.ts
+++ b/apps/studio/data/feedback/upgrade-survey-send.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type SendUpgradeFeedbackVariables = {
orgSlug?: string
@@ -38,7 +38,7 @@ export const useSendUpgradeFeedbackMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SendUpgradeFeedbackData, ResponseError, SendUpgradeFeedbackVariables>,
+ UseCustomMutationOptions<SendUpgradeFeedbackData, ResponseError, SendUpgradeFeedbackVariables>,
'mutationFn'
> = {}) => {
return useMutation<SendUpgradeFeedbackData, ResponseError, SendUpgradeFeedbackVariables>({
diff --git a/apps/studio/data/foreign-tables/foreign-tables-query.ts b/apps/studio/data/foreign-tables/foreign-tables-query.ts
index cb6cfd90e93..5de130a2904 100644
--- a/apps/studio/data/foreign-tables/foreign-tables-query.ts
+++ b/apps/studio/data/foreign-tables/foreign-tables-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { PostgresView } from '@supabase/postgres-meta'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { foreignTableKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type ForeignTablesVariables = {
projectRef?: string
@@ -46,7 +46,10 @@ export type ForeignTablesError = ResponseError
export const useForeignTablesQuery = <TData = ForeignTablesData>(
{ projectRef, connectionString, schema }: ForeignTablesVariables,
- { enabled = true, ...options }: UseQueryOptions<ForeignTablesData, ForeignTablesError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ForeignTablesData, ForeignTablesError, TData> = {}
) =>
useQuery<ForeignTablesData, ForeignTablesError, TData>({
queryKey: schema
diff --git a/apps/studio/data/integrations/aws-redirect-query.ts b/apps/studio/data/integrations/aws-redirect-query.ts
index 36699c47bff..a70f909acd1 100644
--- a/apps/studio/data/integrations/aws-redirect-query.ts
+++ b/apps/studio/data/integrations/aws-redirect-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
-import type { ResponseError } from 'types'
-import { integrationKeys } from './keys'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
+import { integrationKeys } from './keys'
export type AwsRedirectVariables = {
organizationSlug?: string
@@ -26,7 +26,10 @@ export type AwsRedirectError = ResponseError
export const useAwsRedirectQuery = <TData = AwsRedirectData>(
{ organizationSlug }: AwsRedirectVariables,
- { enabled = true, ...options }: UseQueryOptions<AwsRedirectData, AwsRedirectError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<AwsRedirectData, AwsRedirectError, TData> = {}
) =>
useQuery<AwsRedirectData, AwsRedirectError, TData>({
queryKey: integrationKeys.awsRedirect(organizationSlug),
diff --git a/apps/studio/data/integrations/github-authorization-create-mutation.ts b/apps/studio/data/integrations/github-authorization-create-mutation.ts
index c812e16faa2..3fd22101d17 100644
--- a/apps/studio/data/integrations/github-authorization-create-mutation.ts
+++ b/apps/studio/data/integrations/github-authorization-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
import { LOCAL_STORAGE_KEYS } from 'common'
+import { handleError, post } from 'data/fetchers'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type GitHubAuthorizationCreateVariables = {
code: string
@@ -37,7 +37,7 @@ export const useGitHubAuthorizationCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
GitHubAuthorizationCreateData,
ResponseError,
GitHubAuthorizationCreateVariables
diff --git a/apps/studio/data/integrations/github-authorization-query.ts b/apps/studio/data/integrations/github-authorization-query.ts
index 8bde6edd0fb..78f9586efb7 100644
--- a/apps/studio/data/integrations/github-authorization-query.ts
+++ b/apps/studio/data/integrations/github-authorization-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
// FIXME(kamil): Do not retry, a single check is fine.
@@ -21,7 +21,7 @@ export type GitHubAuthorizationError = ResponseError
export const useGitHubAuthorizationQuery = <TData = GitHubAuthorizationData>({
enabled = true,
...options
-}: UseQueryOptions<GitHubAuthorizationData, GitHubAuthorizationError, TData> = {}) => {
+}: UseCustomQueryOptions<GitHubAuthorizationData, GitHubAuthorizationError, TData> = {}) => {
return useQuery<GitHubAuthorizationData, GitHubAuthorizationError, TData>({
queryKey: integrationKeys.githubAuthorization(),
queryFn: ({ signal }) => getGitHubAuthorization(signal),
diff --git a/apps/studio/data/integrations/github-branch-check-query.ts b/apps/studio/data/integrations/github-branch-check-query.ts
index dd543cf89d3..2abf3892c12 100644
--- a/apps/studio/data/integrations/github-branch-check-query.ts
+++ b/apps/studio/data/integrations/github-branch-check-query.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type GithubBranchVariables = {
repositoryId: number
@@ -37,7 +37,7 @@ export const useCheckGithubBranchValidity = ({
onError,
...options
}: Omit<
- UseMutationOptions<GitHubIntegrationCreateData, ResponseError, GithubBranchVariables>,
+ UseCustomMutationOptions<GitHubIntegrationCreateData, ResponseError, GithubBranchVariables>,
'mutationFn'
> = {}) => {
return useMutation<GitHubIntegrationCreateData, ResponseError, GithubBranchVariables>({
diff --git a/apps/studio/data/integrations/github-branches-query.ts b/apps/studio/data/integrations/github-branches-query.ts
index d8d441b8489..6cc295f83e6 100644
--- a/apps/studio/data/integrations/github-branches-query.ts
+++ b/apps/studio/data/integrations/github-branches-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
export type GitHubBranchesVariables = {
@@ -30,7 +30,7 @@ export const useGitHubBranchesQuery = <TData = GitHubBranchesData>(
{
enabled = true,
...options
- }: UseQueryOptions<GitHubBranchesData, GitHubBranchesError, TData> = {}
+ }: UseCustomQueryOptions<GitHubBranchesData, GitHubBranchesError, TData> = {}
) =>
useQuery<GitHubBranchesData, GitHubBranchesError, TData>({
queryKey: integrationKeys.githubBranchesList(connectionId),
diff --git a/apps/studio/data/integrations/github-connection-create-mutation.ts b/apps/studio/data/integrations/github-connection-create-mutation.ts
index befd6698c43..cb23822a737 100644
--- a/apps/studio/data/integrations/github-connection-create-mutation.ts
+++ b/apps/studio/data/integrations/github-connection-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { integrationKeys } from './keys'
type GitHubConnectionCreateVariables = {
@@ -27,7 +27,11 @@ export const useGitHubConnectionCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<GitHubConnectionCreateData, ResponseError, GitHubConnectionCreateVariables>,
+ UseCustomMutationOptions<
+ GitHubConnectionCreateData,
+ ResponseError,
+ GitHubConnectionCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/github-connection-delete-mutation.ts b/apps/studio/data/integrations/github-connection-delete-mutation.ts
index 4b43017a828..9907c36b1a2 100644
--- a/apps/studio/data/integrations/github-connection-delete-mutation.ts
+++ b/apps/studio/data/integrations/github-connection-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { integrationKeys } from './keys'
type DeleteVariables = {
@@ -27,7 +27,7 @@ export const useGitHubConnectionDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DeleteContentData, ResponseError, DeleteVariables>,
+ UseCustomMutationOptions<DeleteContentData, ResponseError, DeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/github-connection-update-mutation.ts b/apps/studio/data/integrations/github-connection-update-mutation.ts
index 55b1bbb81e9..cbec34ad222 100644
--- a/apps/studio/data/integrations/github-connection-update-mutation.ts
+++ b/apps/studio/data/integrations/github-connection-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { integrationKeys } from './keys'
type GitHubConnectionUpdateVariables = {
@@ -33,7 +33,7 @@ export const useGitHubConnectionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateContentData, ResponseError, GitHubConnectionUpdateVariables>,
+ UseCustomMutationOptions<UpdateContentData, ResponseError, GitHubConnectionUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/github-connections-query.ts b/apps/studio/data/integrations/github-connections-query.ts
index 6f031f1344d..16e066e9911 100644
--- a/apps/studio/data/integrations/github-connections-query.ts
+++ b/apps/studio/data/integrations/github-connections-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
export type GitHubConnectionsVariables = {
@@ -37,7 +37,7 @@ export const useGitHubConnectionsQuery = <TData = GitHubConnectionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<GitHubConnectionsData, GitHubConnectionsError, TData> = {}
+ }: UseCustomQueryOptions<GitHubConnectionsData, GitHubConnectionsError, TData> = {}
) => {
return useQuery<GitHubConnectionsData, GitHubConnectionsError, TData>({
queryKey: integrationKeys.githubConnectionsList(organizationId),
diff --git a/apps/studio/data/integrations/github-repositories-query.ts b/apps/studio/data/integrations/github-repositories-query.ts
index 44ff23ab018..9ac089e0a2b 100644
--- a/apps/studio/data/integrations/github-repositories-query.ts
+++ b/apps/studio/data/integrations/github-repositories-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
export async function getGitHubRepositories(signal?: AbortSignal) {
@@ -22,7 +22,7 @@ export type GitHubRepositoriesError = ResponseError
export const useGitHubRepositoriesQuery = <TData = GitHubRepositoriesData>({
enabled = true,
...options
-}: UseQueryOptions<GitHubRepositoriesData, GitHubRepositoriesError, TData> = {}) => {
+}: UseCustomQueryOptions<GitHubRepositoriesData, GitHubRepositoriesError, TData> = {}) => {
return useQuery<GitHubRepositoriesData, GitHubRepositoriesError, TData>({
queryKey: integrationKeys.githubRepositoriesList(),
queryFn: ({ signal }) => getGitHubRepositories(signal),
diff --git a/apps/studio/data/integrations/integrations-query-org-only.ts b/apps/studio/data/integrations/integrations-query-org-only.ts
index ce6fdbb6111..72afeab33a6 100644
--- a/apps/studio/data/integrations/integrations-query-org-only.ts
+++ b/apps/studio/data/integrations/integrations-query-org-only.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { Integration } from './integrations.types'
import { integrationKeys } from './keys'
@@ -25,7 +25,10 @@ export type IntegrationsError = ResponseError
export const useOrgIntegrationsQuery = <TData = IntegrationsData>(
{ orgSlug }: IntegrationsVariables,
- { enabled = true, ...options }: UseQueryOptions<IntegrationsData, IntegrationsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<IntegrationsData, IntegrationsError, TData> = {}
) =>
useQuery<IntegrationsData, IntegrationsError, TData>({
queryKey: integrationKeys.integrationsListWithOrg(orgSlug),
diff --git a/apps/studio/data/integrations/integrations-query.ts b/apps/studio/data/integrations/integrations-query.ts
index efdae8e3eb2..8e18d74b8ce 100644
--- a/apps/studio/data/integrations/integrations-query.ts
+++ b/apps/studio/data/integrations/integrations-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
export async function getIntegrations(signal?: AbortSignal) {
@@ -20,7 +20,7 @@ export type IntegrationsError = ResponseError
export const useIntegrationsQuery = <TData = IntegrationsData>({
enabled = true,
...options
-}: UseQueryOptions<IntegrationsData, IntegrationsError, TData> = {}) =>
+}: UseCustomQueryOptions<IntegrationsData, IntegrationsError, TData> = {}) =>
useQuery<IntegrationsData, IntegrationsError, TData>({
queryKey: integrationKeys.integrationsList(),
queryFn: ({ signal }) => getIntegrations(signal),
diff --git a/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts b/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts
index 862350bf11b..057e3edc21a 100644
--- a/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts
+++ b/apps/studio/data/integrations/integrations-vercel-connection-sync-envs-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type IntegrationsVercelConnectionSyncEnvsVariables = {
connectionId: string
@@ -33,7 +33,7 @@ export const useIntegrationsVercelConnectionSyncEnvsMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
IntegrationsVercelConnectionSyncEnvsData,
ResponseError,
IntegrationsVercelConnectionSyncEnvsVariables
diff --git a/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts b/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
index ff6657312a8..fdae57ee171 100644
--- a/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
+++ b/apps/studio/data/integrations/integrations-vercel-connections-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
import { useIntegrationInstallationSnapshot } from 'state/integration-installation'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { IntegrationConnectionsCreateVariables } from './integrations.types'
import { integrationKeys } from './keys'
@@ -35,7 +35,7 @@ export const useIntegrationVercelConnectionsCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
IntegrationVercelConnectionsCreateData,
ResponseError,
IntegrationConnectionsCreateVariables
diff --git a/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts b/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts
index 30eb1edf662..41d0768f7cd 100644
--- a/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts
+++ b/apps/studio/data/integrations/integrations-vercel-installed-connection-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { integrationKeys } from './keys'
type DeleteVariables = {
@@ -33,7 +33,7 @@ export const useIntegrationsVercelInstalledConnectionDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DeleteContentData, ResponseError, DeleteVariables>,
+ UseCustomMutationOptions<DeleteContentData, ResponseError, DeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/integrations-vercel-projects-query.ts b/apps/studio/data/integrations/integrations-vercel-projects-query.ts
index f504315d860..634ef1d9322 100644
--- a/apps/studio/data/integrations/integrations-vercel-projects-query.ts
+++ b/apps/studio/data/integrations/integrations-vercel-projects-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { integrationKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type VercelProjectsVariables = {
organization_integration_id: string | undefined
@@ -42,7 +43,7 @@ export const useVercelProjectsQuery = <TData = VercelProjectsData>(
{
enabled = true,
...options
- }: UseQueryOptions<VercelProjectsData, VercelProjectsError, TData> = {}
+ }: UseCustomQueryOptions<VercelProjectsData, VercelProjectsError, TData> = {}
) =>
useQuery<VercelProjectsData, VercelProjectsError, TData>({
queryKey: integrationKeys.vercelProjectList(organization_integration_id),
diff --git a/apps/studio/data/integrations/vercel-connection-update-mutate.ts b/apps/studio/data/integrations/vercel-connection-update-mutate.ts
index c4514d2f374..5c9e020cc30 100644
--- a/apps/studio/data/integrations/vercel-connection-update-mutate.ts
+++ b/apps/studio/data/integrations/vercel-connection-update-mutate.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { EnvironmentTargets } from './integrations.types'
import { integrationKeys } from './keys'
@@ -40,7 +40,7 @@ export const useVercelConnectionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateVercelConnectionData, ResponseError, UpdateConnectionPayload>,
+ UseCustomMutationOptions<UpdateVercelConnectionData, ResponseError, UpdateConnectionPayload>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/vercel-integration-create-mutation.ts b/apps/studio/data/integrations/vercel-integration-create-mutation.ts
index 6bc91571d61..996dd0507f6 100644
--- a/apps/studio/data/integrations/vercel-integration-create-mutation.ts
+++ b/apps/studio/data/integrations/vercel-integration-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { integrationKeys } from './keys'
export type VercelIntegrationCreateVariables = {
@@ -48,7 +48,11 @@ export const useVercelIntegrationCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<VercelIntegrationCreateData, ResponseError, VercelIntegrationCreateVariables>,
+ UseCustomMutationOptions<
+ VercelIntegrationCreateData,
+ ResponseError,
+ VercelIntegrationCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/integrations/vercel-redirect-query.ts b/apps/studio/data/integrations/vercel-redirect-query.ts
index 08cd018a96e..bf89940f8ad 100644
--- a/apps/studio/data/integrations/vercel-redirect-query.ts
+++ b/apps/studio/data/integrations/vercel-redirect-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { integrationKeys } from './keys'
export type VercelRedirectVariables = {
@@ -30,7 +30,7 @@ export const useVercelRedirectQuery = <TData = VercelRedirectData>(
{
enabled = true,
...options
- }: UseQueryOptions<VercelRedirectData, VercelRedirectError, TData> = {}
+ }: UseCustomQueryOptions<VercelRedirectData, VercelRedirectError, TData> = {}
) =>
useQuery<VercelRedirectData, VercelRedirectError, TData>({
queryKey: integrationKeys.vercelRedirect(installationId),
diff --git a/apps/studio/data/invoices/invoice-payment-link-mutation.ts b/apps/studio/data/invoices/invoice-payment-link-mutation.ts
index 6bbd7ffcb64..5433633f444 100644
--- a/apps/studio/data/invoices/invoice-payment-link-mutation.ts
+++ b/apps/studio/data/invoices/invoice-payment-link-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { invoicesKeys } from './keys'
export type InvoicePaymentLinkGetVariables = {
@@ -39,7 +39,11 @@ export const useInvoicePaymentLinkGetMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<InvoicePaymentLinkGetData, ResponseError, InvoicePaymentLinkGetVariables>,
+ UseCustomMutationOptions<
+ InvoicePaymentLinkGetData,
+ ResponseError,
+ InvoicePaymentLinkGetVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/invoices/invoice-query.ts b/apps/studio/data/invoices/invoice-query.ts
index 638d8f90a45..c0133fdede1 100644
--- a/apps/studio/data/invoices/invoice-query.ts
+++ b/apps/studio/data/invoices/invoice-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { invoicesKeys } from './keys'
export type InvoiceVariables = {
@@ -29,7 +29,7 @@ export type InvoiceError = ResponseError
export const useInvoiceQuery = <TData = InvoiceData>(
{ invoiceId: id }: InvoiceVariables,
- { enabled = true, ...options }: UseQueryOptions<InvoiceData, InvoiceError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<InvoiceData, InvoiceError, TData> = {}
) =>
useQuery<InvoiceData, InvoiceError, TData>({
queryKey: invoicesKeys.invoice(id),
diff --git a/apps/studio/data/invoices/invoices-count-query.ts b/apps/studio/data/invoices/invoices-count-query.ts
index a189cc91236..985993704f5 100644
--- a/apps/studio/data/invoices/invoices-count-query.ts
+++ b/apps/studio/data/invoices/invoices-count-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { head } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { invoicesKeys } from './keys'
export type InvoicesCountVariables = {
@@ -25,7 +25,10 @@ export type InvoicesCountError = ResponseError
export const useInvoicesCountQuery = <TData = InvoicesCountData>(
{ slug }: InvoicesCountVariables,
- { enabled = true, ...options }: UseQueryOptions<InvoicesCountData, InvoicesCountError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<InvoicesCountData, InvoicesCountError, TData> = {}
) =>
useQuery<InvoicesCountData, InvoicesCountError, TData>({
queryKey: invoicesKeys.count(slug),
diff --git a/apps/studio/data/invoices/invoices-overdue-query.ts b/apps/studio/data/invoices/invoices-overdue-query.ts
index b31a76bdb26..87a6d5e27db 100644
--- a/apps/studio/data/invoices/invoices-overdue-query.ts
+++ b/apps/studio/data/invoices/invoices-overdue-query.ts
@@ -1,9 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { useIsLoggedIn } from 'common'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import { invoicesKeys } from './keys'
import { IS_PLATFORM } from 'lib/constants'
-import { useIsLoggedIn } from 'common'
+import { invoicesKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type OverdueInvoicesResponse = components['schemas']['OverdueInvoiceCount']
@@ -22,7 +23,7 @@ export type OverdueInvoicesError = unknown
export const useOverdueInvoicesQuery = <TData = OverdueInvoicesData>({
enabled = true,
...options
-}: UseQueryOptions<OverdueInvoicesData, OverdueInvoicesError, TData> = {}) => {
+}: UseCustomQueryOptions<OverdueInvoicesData, OverdueInvoicesError, TData> = {}) => {
const isLoggedIn = useIsLoggedIn()
return useQuery<OverdueInvoicesData, OverdueInvoicesError, TData>({
queryKey: invoicesKeys.overdueInvoices(),
diff --git a/apps/studio/data/invoices/invoices-query.ts b/apps/studio/data/invoices/invoices-query.ts
index ff3118d31e9..ba72cd2b38a 100644
--- a/apps/studio/data/invoices/invoices-query.ts
+++ b/apps/studio/data/invoices/invoices-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { invoicesKeys } from './keys'
export type InvoicesVariables = {
@@ -32,7 +32,7 @@ export type InvoicesError = ResponseError
export const useInvoicesQuery = <TData = InvoicesData>(
{ slug, offset, limit }: InvoicesVariables,
- { enabled = true, ...options }: UseQueryOptions<InvoicesData, InvoicesError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<InvoicesData, InvoicesError, TData> = {}
) =>
// [Joshen] Switch to useInfiniteQuery
useQuery<InvoicesData, InvoicesError, TData>({
diff --git a/apps/studio/data/invoices/org-invoice-upcoming-query.ts b/apps/studio/data/invoices/org-invoice-upcoming-query.ts
index 18aeb58b936..2a187425a1a 100644
--- a/apps/studio/data/invoices/org-invoice-upcoming-query.ts
+++ b/apps/studio/data/invoices/org-invoice-upcoming-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { PricingMetric } from 'data/analytics/org-daily-stats-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { invoicesKeys } from './keys'
export type UpcomingInvoiceVariables = {
@@ -68,7 +68,7 @@ export const useOrgUpcomingInvoiceQuery = <TData = UpcomingInvoiceData>(
{
enabled = true,
...options
- }: UseQueryOptions<UpcomingInvoiceData, UpcomingInvoiceError, TData> = {}
+ }: UseCustomQueryOptions<UpcomingInvoiceData, UpcomingInvoiceError, TData> = {}
) =>
useQuery<UpcomingInvoiceData, UpcomingInvoiceError, TData>({
queryKey: invoicesKeys.orgUpcomingPreview(orgSlug),
diff --git a/apps/studio/data/jwt-signing-keys/jwt-signing-key-create-mutation.ts b/apps/studio/data/jwt-signing-keys/jwt-signing-key-create-mutation.ts
index 8c662686c73..a9ad8ac9649 100644
--- a/apps/studio/data/jwt-signing-keys/jwt-signing-key-create-mutation.ts
+++ b/apps/studio/data/jwt-signing-keys/jwt-signing-key-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { JWTAlgorithm } from './jwt-signing-keys-query'
import { jwtSigningKeysKeys } from './keys'
@@ -38,7 +38,7 @@ export const useJWTSigningKeyCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<JWTSigningKeyCreateData, ResponseError, JWTSigningKeyCreateVariables>,
+ UseCustomMutationOptions<JWTSigningKeyCreateData, ResponseError, JWTSigningKeyCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/jwt-signing-keys/jwt-signing-key-delete-mutation.ts b/apps/studio/data/jwt-signing-keys/jwt-signing-key-delete-mutation.ts
index 4b5cc07bdde..1b5791894f3 100644
--- a/apps/studio/data/jwt-signing-keys/jwt-signing-key-delete-mutation.ts
+++ b/apps/studio/data/jwt-signing-keys/jwt-signing-key-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { jwtSigningKeysKeys } from './keys'
interface JWTSigningKeyDeleteVariables {
@@ -30,7 +30,7 @@ export const useJWTSigningKeyDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<JWTSigningKeyDeleteData, ResponseError, JWTSigningKeyDeleteVariables>,
+ UseCustomMutationOptions<JWTSigningKeyDeleteData, ResponseError, JWTSigningKeyDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/jwt-signing-keys/jwt-signing-key-update-mutation.ts b/apps/studio/data/jwt-signing-keys/jwt-signing-key-update-mutation.ts
index 83198de5b5e..67e6c950baf 100644
--- a/apps/studio/data/jwt-signing-keys/jwt-signing-key-update-mutation.ts
+++ b/apps/studio/data/jwt-signing-keys/jwt-signing-key-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { jwtSigningKeysKeys } from './keys'
interface JWTSigningKeyUpdateVariables {
@@ -34,7 +34,7 @@ export const useJWTSigningKeyUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<JWTSigningKeyUpdateData, ResponseError, JWTSigningKeyUpdateVariables>,
+ UseCustomMutationOptions<JWTSigningKeyUpdateData, ResponseError, JWTSigningKeyUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/jwt-signing-keys/jwt-signing-keys-query.ts b/apps/studio/data/jwt-signing-keys/jwt-signing-keys-query.ts
index 959dbf5abf6..b990cc694b2 100644
--- a/apps/studio/data/jwt-signing-keys/jwt-signing-keys-query.ts
+++ b/apps/studio/data/jwt-signing-keys/jwt-signing-keys-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { jwtSigningKeysKeys } from './keys'
export type JWTSigningKey = components['schemas']['SigningKeyResponse']
@@ -31,7 +31,7 @@ export type JWTSigningKeysData = Awaited<ReturnType<typeof getJWTSigningKeys>>
export const useJWTSigningKeysQuery = <TData = JWTSigningKeysData>(
{ projectRef }: JWTSigningKeysVariables,
- { enabled, ...options }: UseQueryOptions<JWTSigningKeysData, ResponseError, TData> = {}
+ { enabled, ...options }: UseCustomQueryOptions<JWTSigningKeysData, ResponseError, TData> = {}
) =>
useQuery<JWTSigningKeysData, ResponseError, TData>({
queryKey: jwtSigningKeysKeys.list(projectRef),
diff --git a/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-create-mutation.ts b/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-create-mutation.ts
index 32e40a80fde..495bee859bf 100644
--- a/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-create-mutation.ts
+++ b/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { jwtSigningKeysKeys } from './keys'
interface LegacyJWTSigningKeyCreateVariables {
@@ -29,7 +29,7 @@ export const useLegacyJWTSigningKeyCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
LegacyJWTSigningKeyCreateData,
ResponseError,
LegacyJWTSigningKeyCreateVariables
diff --git a/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-query.ts b/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-query.ts
index 23be0df5bc5..122c6c7a645 100644
--- a/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-query.ts
+++ b/apps/studio/data/jwt-signing-keys/legacy-jwt-signing-key-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { jwtSigningKeysKeys } from './keys'
@@ -30,7 +30,7 @@ export type LegacyJWTSigningKeyData = Awaited<ReturnType<typeof getLegacyJWTSign
export const useLegacyJWTSigningKeyQuery = <TData = LegacyJWTSigningKeyData>(
{ projectRef }: LegacyJWTSigningKeyVariables,
- { enabled, ...options }: UseQueryOptions<LegacyJWTSigningKeyData, ResponseError, TData> = {}
+ { enabled, ...options }: UseCustomQueryOptions<LegacyJWTSigningKeyData, ResponseError, TData> = {}
) =>
useQuery<LegacyJWTSigningKeyData, ResponseError, TData>({
queryKey: jwtSigningKeysKeys.legacy(projectRef),
diff --git a/apps/studio/data/lint/create-lint-rule-mutation.ts b/apps/studio/data/lint/create-lint-rule-mutation.ts
index 11f0d8a1f59..37741c58dc0 100644
--- a/apps/studio/data/lint/create-lint-rule-mutation.ts
+++ b/apps/studio/data/lint/create-lint-rule-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { lintKeys } from './keys'
type ExceptionPayload = components['schemas']['CreateNotificationExceptionsBody']['exceptions'][0]
@@ -32,7 +32,7 @@ export const useLintRuleCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LintRuleCreateData, ResponseError, LintRuleCreateVariables>,
+ UseCustomMutationOptions<LintRuleCreateData, ResponseError, LintRuleCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/lint/delete-lint-rule-mutation.ts b/apps/studio/data/lint/delete-lint-rule-mutation.ts
index 4a2a43c98f2..5c255b7cd73 100644
--- a/apps/studio/data/lint/delete-lint-rule-mutation.ts
+++ b/apps/studio/data/lint/delete-lint-rule-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { lintKeys } from './keys'
export type LintRuleDeleteVariables = {
@@ -26,7 +26,7 @@ export const useLintRuleDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LintRuleDeleteData, ResponseError, LintRuleDeleteVariables>,
+ UseCustomMutationOptions<LintRuleDeleteData, ResponseError, LintRuleDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/lint/lint-query.ts b/apps/studio/data/lint/lint-query.ts
index bcb7fdf5be2..f73adbcbe74 100644
--- a/apps/studio/data/lint/lint-query.ts
+++ b/apps/studio/data/lint/lint-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { lintKeys } from './keys'
type ProjectLintsVariables = {
@@ -32,7 +32,10 @@ export type ProjectLintsError = ResponseError
export const useProjectLintsQuery = <TData = ProjectLintsData>(
{ projectRef }: ProjectLintsVariables,
- { enabled = true, ...options }: UseQueryOptions<ProjectLintsData, ProjectLintsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ProjectLintsData, ProjectLintsError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/lint/lint-rules-query.ts b/apps/studio/data/lint/lint-rules-query.ts
index 7cdd94bfed9..56dd4c0ca9c 100644
--- a/apps/studio/data/lint/lint-rules-query.ts
+++ b/apps/studio/data/lint/lint-rules-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { lintKeys } from './keys'
type ProjectLintRulesVariables = {
@@ -37,7 +37,7 @@ export const useProjectLintRulesQuery = <TData = ProjectLintRulesData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectLintRulesData, ProjectLintRulesError, TData> = {}
+ }: UseCustomQueryOptions<ProjectLintRulesData, ProjectLintRulesError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/log-drains/create-log-drain-mutation.ts b/apps/studio/data/log-drains/create-log-drain-mutation.ts
index afc9467afd7..4b92b00a9e0 100644
--- a/apps/studio/data/log-drains/create-log-drain-mutation.ts
+++ b/apps/studio/data/log-drains/create-log-drain-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { LogDrainType } from 'components/interfaces/LogDrains/LogDrains.constants'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { logDrainsKeys } from './keys'
export type LogDrainCreateVariables = {
@@ -36,7 +36,7 @@ export const useCreateLogDrainMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LogDrainCreateData, ResponseError, LogDrainCreateVariables>,
+ UseCustomMutationOptions<LogDrainCreateData, ResponseError, LogDrainCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/log-drains/delete-log-drain-mutation.ts b/apps/studio/data/log-drains/delete-log-drain-mutation.ts
index 075e11fa223..cfe481deded 100644
--- a/apps/studio/data/log-drains/delete-log-drain-mutation.ts
+++ b/apps/studio/data/log-drains/delete-log-drain-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { logDrainsKeys } from './keys'
export type LogDrainDeleteVariables = {
@@ -27,7 +27,7 @@ export const useDeleteLogDrainMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LogDrainDeleteData, ResponseError, LogDrainDeleteVariables>,
+ UseCustomMutationOptions<LogDrainDeleteData, ResponseError, LogDrainDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/log-drains/log-drains-query.ts b/apps/studio/data/log-drains/log-drains-query.ts
index bcc5a349e09..a5d616e5abf 100644
--- a/apps/studio/data/log-drains/log-drains-query.ts
+++ b/apps/studio/data/log-drains/log-drains-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { logDrainsKeys } from './keys'
export type LogDrainsVariables = {
@@ -30,7 +30,7 @@ export type LogDrainsyError = ResponseError
export const useLogDrainsQuery = <TData = LogDrainsData>(
{ ref }: LogDrainsVariables,
- { enabled = true, ...options }: UseQueryOptions<LogDrainsData, LogDrainsyError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<LogDrainsData, LogDrainsyError, TData> = {}
) =>
useQuery<LogDrainsData, LogDrainsyError, TData>({
queryKey: logDrainsKeys.list(ref),
diff --git a/apps/studio/data/log-drains/update-log-drain-mutation.ts b/apps/studio/data/log-drains/update-log-drain-mutation.ts
index 05f681088e9..88ae9d54c99 100644
--- a/apps/studio/data/log-drains/update-log-drain-mutation.ts
+++ b/apps/studio/data/log-drains/update-log-drain-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { LogDrainType } from 'components/interfaces/LogDrains/LogDrains.constants'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { logDrainsKeys } from './keys'
export type LogDrainUpdateVariables = {
@@ -41,7 +41,7 @@ export const useUpdateLogDrainMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LogDrainUpdateData, ResponseError, LogDrainUpdateVariables>,
+ UseCustomMutationOptions<LogDrainUpdateData, ResponseError, LogDrainUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/logs/get-unified-logs.ts b/apps/studio/data/logs/get-unified-logs.ts
index 66ebdfb4ee5..2151c5c11c0 100644
--- a/apps/studio/data/logs/get-unified-logs.ts
+++ b/apps/studio/data/logs/get-unified-logs.ts
@@ -1,10 +1,10 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { getUnifiedLogsQuery } from 'components/interfaces/UnifiedLogs/UnifiedLogs.queries'
import { QuerySearchParamsType } from 'components/interfaces/UnifiedLogs/UnifiedLogs.types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { getUnifiedLogsISOStartEnd } from './unified-logs-infinite-query'
export type getUnifiedLogsVariables = {
@@ -69,7 +69,7 @@ export const useGetUnifiedLogsMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LogDrainCreateData, ResponseError, getUnifiedLogsVariables>,
+ UseCustomMutationOptions<LogDrainCreateData, ResponseError, getUnifiedLogsVariables>,
'mutationFn'
> = {}) => {
return useMutation<LogDrainCreateData, ResponseError, getUnifiedLogsVariables>({
diff --git a/apps/studio/data/logs/unified-log-inspection-query.ts b/apps/studio/data/logs/unified-log-inspection-query.ts
index a9be4009fec..b23d231c2f9 100644
--- a/apps/studio/data/logs/unified-log-inspection-query.ts
+++ b/apps/studio/data/logs/unified-log-inspection-query.ts
@@ -1,4 +1,4 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import {
getAuthServiceFlowQuery,
@@ -9,7 +9,7 @@ import {
} from 'components/interfaces/UnifiedLogs/Queries/ServiceFlowQueries/ServiceFlow.sql'
import { QuerySearchParamsType } from 'components/interfaces/UnifiedLogs/UnifiedLogs.types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { logsKeys } from './keys'
import {
getUnifiedLogsISOStartEnd,
@@ -178,7 +178,7 @@ export const useUnifiedLogInspectionQuery = <TData = UnifiedLogInspectionData>(
{
enabled = true,
...options
- }: UseQueryOptions<UnifiedLogInspectionData, UnifiedLogInspectionError, TData> = {}
+ }: UseCustomQueryOptions<UnifiedLogInspectionData, UnifiedLogInspectionError, TData> = {}
) =>
useQuery<UnifiedLogInspectionData, UnifiedLogInspectionError, TData>({
queryKey: logsKeys.serviceFlow(projectRef, search, logId),
diff --git a/apps/studio/data/logs/unified-logs-chart-query.ts b/apps/studio/data/logs/unified-logs-chart-query.ts
index 90039ac1484..f795c9f199f 100644
--- a/apps/studio/data/logs/unified-logs-chart-query.ts
+++ b/apps/studio/data/logs/unified-logs-chart-query.ts
@@ -1,10 +1,11 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { getLogsChartQuery } from 'components/interfaces/UnifiedLogs/UnifiedLogs.queries'
import { handleError, post } from 'data/fetchers'
import { ExecuteSqlError } from 'data/sql/execute-sql-query'
import { logsKeys } from './keys'
import { UNIFIED_LOGS_QUERY_OPTIONS, UnifiedLogsVariables } from './unified-logs-infinite-query'
+import { UseCustomQueryOptions } from 'types'
export async function getUnifiedLogsChart(
{ projectRef, search }: UnifiedLogsVariables,
@@ -148,7 +149,7 @@ export const useUnifiedLogsChartQuery = <TData = UnifiedLogsChartData>(
{
enabled = true,
...options
- }: UseQueryOptions<UnifiedLogsChartData, UnifiedLogsChartError, TData> = {}
+ }: UseCustomQueryOptions<UnifiedLogsChartData, UnifiedLogsChartError, TData> = {}
) =>
useQuery<UnifiedLogsChartData, UnifiedLogsChartError, TData>({
queryKey: logsKeys.unifiedLogsChart(projectRef, search),
diff --git a/apps/studio/data/logs/unified-logs-count-query.ts b/apps/studio/data/logs/unified-logs-count-query.ts
index b6511469dc5..b0408e15499 100644
--- a/apps/studio/data/logs/unified-logs-count-query.ts
+++ b/apps/studio/data/logs/unified-logs-count-query.ts
@@ -1,9 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { getLogsCountQuery } from 'components/interfaces/UnifiedLogs/UnifiedLogs.queries'
import { FacetMetadataSchema } from 'components/interfaces/UnifiedLogs/UnifiedLogs.schema'
import { handleError, post } from 'data/fetchers'
import { ExecuteSqlError } from 'data/sql/execute-sql-query'
+import { UseCustomQueryOptions } from 'types'
import { logsKeys } from './keys'
import {
getUnifiedLogsISOStartEnd,
@@ -81,7 +82,7 @@ export const useUnifiedLogsCountQuery = <TData = UnifiedLogsCountData>(
{
enabled = true,
...options
- }: UseQueryOptions<UnifiedLogsCountData, UnifiedLogsCountError, TData> = {}
+ }: UseCustomQueryOptions<UnifiedLogsCountData, UnifiedLogsCountError, TData> = {}
) =>
useQuery<UnifiedLogsCountData, UnifiedLogsCountError, TData>({
queryKey: logsKeys.unifiedLogsCount(projectRef, search),
diff --git a/apps/studio/data/logs/unified-logs-facet-count-query.ts b/apps/studio/data/logs/unified-logs-facet-count-query.ts
index c6241a51e12..d8767876135 100644
--- a/apps/studio/data/logs/unified-logs-facet-count-query.ts
+++ b/apps/studio/data/logs/unified-logs-facet-count-query.ts
@@ -1,4 +1,4 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import {
getFacetCountCTE,
@@ -7,6 +7,7 @@ import {
import { Option } from 'components/ui/DataTable/DataTable.types'
import { handleError, post } from 'data/fetchers'
import { ExecuteSqlError } from 'data/sql/execute-sql-query'
+import { UseCustomQueryOptions } from 'types'
import { logsKeys } from './keys'
import {
getUnifiedLogsISOStartEnd,
@@ -51,7 +52,7 @@ export const useUnifiedLogsFacetCountQuery = <TData = UnifiedLogsFacetCountData>
{
enabled = true,
...options
- }: UseQueryOptions<UnifiedLogsFacetCountData, UnifiedLogsFacetCountError, TData> = {}
+ }: UseCustomQueryOptions<UnifiedLogsFacetCountData, UnifiedLogsFacetCountError, TData> = {}
) =>
useQuery<UnifiedLogsFacetCountData, UnifiedLogsFacetCountError, TData>({
queryKey: logsKeys.unifiedLogsFacetCount(projectRef, facet, facetSearch, search),
diff --git a/apps/studio/data/logs/unified-logs-infinite-query.ts b/apps/studio/data/logs/unified-logs-infinite-query.ts
index 3dc22ee8f62..70bb70e9322 100644
--- a/apps/studio/data/logs/unified-logs-infinite-query.ts
+++ b/apps/studio/data/logs/unified-logs-infinite-query.ts
@@ -1,4 +1,4 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { getUnifiedLogsQuery } from 'components/interfaces/UnifiedLogs/UnifiedLogs.queries'
import {
@@ -6,7 +6,7 @@ import {
QuerySearchParamsType,
} from 'components/interfaces/UnifiedLogs/UnifiedLogs.types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { logsKeys } from './keys'
const LOGS_PAGE_LIMIT = 50
@@ -159,7 +159,7 @@ export const useUnifiedLogsInfiniteQuery = <TData = UnifiedLogsData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<UnifiedLogsData, UnifiedLogsError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<UnifiedLogsData, UnifiedLogsError, TData> = {}
) => {
return useInfiniteQuery<UnifiedLogsData, UnifiedLogsError, TData>({
queryKey: logsKeys.unifiedLogsInfinite(projectRef, search),
diff --git a/apps/studio/data/materialized-views/materialized-views-query.ts b/apps/studio/data/materialized-views/materialized-views-query.ts
index 331e40543e3..353e0eba606 100644
--- a/apps/studio/data/materialized-views/materialized-views-query.ts
+++ b/apps/studio/data/materialized-views/materialized-views-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { PostgresMaterializedView } from '@supabase/postgres-meta'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { materializedViewKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type MaterializedViewsVariables = {
projectRef?: string
@@ -49,7 +49,7 @@ export const useMaterializedViewsQuery = <TData = MaterializedViewsData>(
{
enabled = true,
...options
- }: UseQueryOptions<MaterializedViewsData, MaterializedViewsError, TData> = {}
+ }: UseCustomQueryOptions<MaterializedViewsData, MaterializedViewsError, TData> = {}
) =>
useQuery<MaterializedViewsData, MaterializedViewsError, TData>({
queryKey: schema
diff --git a/apps/studio/data/misc/audit-login-mutation.ts b/apps/studio/data/misc/audit-login-mutation.ts
index 3e2cca8c7a3..780fefae075 100644
--- a/apps/studio/data/misc/audit-login-mutation.ts
+++ b/apps/studio/data/misc/audit-login-mutation.ts
@@ -1,9 +1,9 @@
import * as Sentry from '@sentry/nextjs'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export async function addLoginEvent() {
const { error } = await post('/platform/profile/audit-login')
@@ -18,7 +18,7 @@ export const useAddLoginEvent = ({
onError,
...options
}: Omit<
- UseMutationOptions<AddLoginEventData, ResponseError, AddLoginEventVariables>,
+ UseCustomMutationOptions<AddLoginEventData, ResponseError, AddLoginEventVariables>,
'mutationFn'
> = {}) => {
return useMutation<AddLoginEventData, ResponseError, AddLoginEventVariables>({
diff --git a/apps/studio/data/misc/cli-release-version-query.ts b/apps/studio/data/misc/cli-release-version-query.ts
index 3a509167dc2..653a4f2e31d 100644
--- a/apps/studio/data/misc/cli-release-version-query.ts
+++ b/apps/studio/data/misc/cli-release-version-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { fetchHandler } from 'data/fetchers'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { miscKeys } from './keys'
export async function getCLIReleaseVersion() {
@@ -22,7 +22,7 @@ export type CLIReleaseVersionError = ResponseError
export const useCLIReleaseVersionQuery = <TData = CLIReleaseVersionData>({
enabled = true,
...options
-}: UseQueryOptions<CLIReleaseVersionData, CLIReleaseVersionError, TData> = {}) =>
+}: UseCustomQueryOptions<CLIReleaseVersionData, CLIReleaseVersionError, TData> = {}) =>
useQuery<CLIReleaseVersionData, CLIReleaseVersionError, TData>({
queryKey: miscKeys.cliReleaseVersion(),
queryFn: () => getCLIReleaseVersion(),
diff --git a/apps/studio/data/misc/get-default-region-query.ts b/apps/studio/data/misc/get-default-region-query.ts
index 104f88ef991..c178769745d 100644
--- a/apps/studio/data/misc/get-default-region-query.ts
+++ b/apps/studio/data/misc/get-default-region-query.ts
@@ -1,4 +1,4 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { useFlag } from 'common'
import { COUNTRY_LAT_LON } from 'components/interfaces/ProjectCreation/ProjectCreation.constants'
@@ -10,7 +10,7 @@ import { fetchHandler } from 'data/fetchers'
import { getDistanceLatLonKM, tryParseJson } from 'lib/helpers'
import type { CloudProvider } from 'shared-data'
import { AWS_REGIONS, FLY_REGIONS } from 'shared-data'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { miscKeys } from './keys'
export type DefaultRegionVariables = {
@@ -70,7 +70,10 @@ export type DefaultRegionError = ResponseError
export const useDefaultRegionQuery = <TData = DefaultRegionData>(
{ cloudProvider, useRestrictedPool }: DefaultRegionVariables,
- { enabled = true, ...options }: UseQueryOptions<DefaultRegionData, DefaultRegionError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<DefaultRegionData, DefaultRegionError, TData> = {}
) => {
// [Joshen] Flag allows us to specify restricted regions for users based on percentage
const restrictedPoolFlag = useFlag('defaultRegionRestrictedPool')
diff --git a/apps/studio/data/misc/reset-password-mutation.ts b/apps/studio/data/misc/reset-password-mutation.ts
index a2d92053d4c..1b302852661 100644
--- a/apps/studio/data/misc/reset-password-mutation.ts
+++ b/apps/studio/data/misc/reset-password-mutation.ts
@@ -1,9 +1,9 @@
import * as Sentry from '@sentry/nextjs'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
const WHITELIST_ERRORS = ['email must be an email']
@@ -30,7 +30,7 @@ export const useResetPasswordMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ResetPasswordData, ResponseError, ResetPasswordVariables>,
+ UseCustomMutationOptions<ResetPasswordData, ResponseError, ResetPasswordVariables>,
'mutationFn'
> = {}) => {
return useMutation<ResetPasswordData, ResponseError, ResetPasswordVariables>({
diff --git a/apps/studio/data/misc/signup-mutation.ts b/apps/studio/data/misc/signup-mutation.ts
index c8ecc47f43e..73530e341fa 100644
--- a/apps/studio/data/misc/signup-mutation.ts
+++ b/apps/studio/data/misc/signup-mutation.ts
@@ -1,9 +1,9 @@
import * as Sentry from '@sentry/nextjs'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
const WHITELIST_ERRORS = [
'A user with this email already exists',
@@ -36,7 +36,10 @@ export const useSignUpMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<SignUpData, ResponseError, SignUpVariables>, 'mutationFn'> = {}) => {
+}: Omit<
+ UseCustomMutationOptions<SignUpData, ResponseError, SignUpVariables>,
+ 'mutationFn'
+> = {}) => {
return useMutation<SignUpData, ResponseError, SignUpVariables>({
mutationFn: (vars) => signup(vars),
async onSuccess(data, variables, context) {
diff --git a/apps/studio/data/misc/user-ip-address-query.ts b/apps/studio/data/misc/user-ip-address-query.ts
index 205b6abf59f..20233f6f345 100644
--- a/apps/studio/data/misc/user-ip-address-query.ts
+++ b/apps/studio/data/misc/user-ip-address-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { fetchHandler } from 'data/fetchers'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { miscKeys } from './keys'
export async function getUserIPAddress() {
@@ -20,7 +20,7 @@ export type UserIPAddressError = ResponseError
export const useUserIPAddressQuery = <TData = UserIPAddressData>({
enabled = true,
...options
-}: UseQueryOptions<UserIPAddressData, UserIPAddressError, TData> = {}) =>
+}: UseCustomQueryOptions<UserIPAddressData, UserIPAddressError, TData> = {}) =>
useQuery<UserIPAddressData, UserIPAddressError, TData>({
queryKey: miscKeys.ipAddress(),
queryFn: () => getUserIPAddress(),
diff --git a/apps/studio/data/network-restrictions/network-restrictions-query.ts b/apps/studio/data/network-restrictions/network-restrictions-query.ts
index 40ac1db3943..7337ef6f481 100644
--- a/apps/studio/data/network-restrictions/network-restrictions-query.ts
+++ b/apps/studio/data/network-restrictions/network-restrictions-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { networkRestrictionKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type NetworkRestrictionsVariables = { projectRef?: string }
@@ -53,7 +54,7 @@ export const useNetworkRestrictionsQuery = <TData = NetworkRestrictionsData>(
{
enabled = true,
...options
- }: UseQueryOptions<NetworkRestrictionsData, NetworkRestrictionsError, TData> = {}
+ }: UseCustomQueryOptions<NetworkRestrictionsData, NetworkRestrictionsError, TData> = {}
) =>
useQuery<NetworkRestrictionsData, NetworkRestrictionsError, TData>({
queryKey: networkRestrictionKeys.list(projectRef),
diff --git a/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts b/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts
index cceb2c51c86..48b69f79e33 100644
--- a/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts
+++ b/apps/studio/data/network-restrictions/network-retrictions-apply-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { networkRestrictionKeys } from './keys'
export type NetworkRestrictionsApplyVariables = {
@@ -34,7 +34,7 @@ export const useNetworkRestrictionsApplyMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
NetworkRestrictionsApplyData,
ResponseError,
NetworkRestrictionsApplyVariables
diff --git a/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts b/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts
index 83ddae2501a..781c446c681 100644
--- a/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts
+++ b/apps/studio/data/notifications/notifications-v2-archive-all-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { notificationKeys } from './keys'
export async function archiveAllNotifications() {
@@ -20,7 +20,10 @@ export const useNotificationsArchiveAllMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<NotificationsArchiveAllData, ResponseError>, 'mutationFn'> = {}) => {
+}: Omit<
+ UseCustomMutationOptions<NotificationsArchiveAllData, ResponseError>,
+ 'mutationFn'
+> = {}) => {
const queryClient = useQueryClient()
return useMutation<NotificationsArchiveAllData, ResponseError>({
mutationFn: () => archiveAllNotifications(),
diff --git a/apps/studio/data/notifications/notifications-v2-query.ts b/apps/studio/data/notifications/notifications-v2-query.ts
index a98e3b2a677..ffd00de107d 100644
--- a/apps/studio/data/notifications/notifications-v2-query.ts
+++ b/apps/studio/data/notifications/notifications-v2-query.ts
@@ -1,8 +1,8 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import type { components } from 'data/api'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { notificationKeys } from './keys'
const NOTIFICATIONS_PAGE_LIMIT = 10
@@ -66,7 +66,7 @@ export const useNotificationsV2Query = <TData = NotificationsData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<NotificationsData, NotificationsError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<NotificationsData, NotificationsError, TData> = {}
) => {
return useInfiniteQuery<NotificationsData, NotificationsError, TData>({
queryKey: notificationKeys.listV2({ status, filters, limit }),
diff --git a/apps/studio/data/notifications/notifications-v2-summary-query.ts b/apps/studio/data/notifications/notifications-v2-summary-query.ts
index ae06cdd01ff..489e89d7641 100644
--- a/apps/studio/data/notifications/notifications-v2-summary-query.ts
+++ b/apps/studio/data/notifications/notifications-v2-summary-query.ts
@@ -1,8 +1,8 @@
import type { Notification } from '@supabase/shared-types/out/notifications'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { notificationKeys } from './keys'
export type NotificationsResponse = Notification[]
@@ -19,7 +19,7 @@ export type NotificationsData = Awaited<ReturnType<typeof getNotificationsSummar
export type NotificationsError = ResponseError
export const useNotificationsSummaryQuery = <TData = NotificationsData>(
- options: UseQueryOptions<NotificationsData, NotificationsError, TData> = {}
+ options: UseCustomQueryOptions<NotificationsData, NotificationsError, TData> = {}
) =>
useQuery<NotificationsData, NotificationsError, TData>({
queryKey: notificationKeys.summary(),
diff --git a/apps/studio/data/notifications/notifications-v2-update-mutation.ts b/apps/studio/data/notifications/notifications-v2-update-mutation.ts
index 3747cce4a6b..4e4586c2cfc 100644
--- a/apps/studio/data/notifications/notifications-v2-update-mutation.ts
+++ b/apps/studio/data/notifications/notifications-v2-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type NotificationsUpdateVariables = {
ids: string[]
@@ -27,7 +27,7 @@ export const useNotificationsV2UpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<NotificationsUpdateData, ResponseError, NotificationsUpdateVariables>,
+ UseCustomMutationOptions<NotificationsUpdateData, ResponseError, NotificationsUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth-secrets/client-secret-create-mutation.ts b/apps/studio/data/oauth-secrets/client-secret-create-mutation.ts
index 1cce6c6fcac..8a6bede51e3 100644
--- a/apps/studio/data/oauth-secrets/client-secret-create-mutation.ts
+++ b/apps/studio/data/oauth-secrets/client-secret-create-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { clientSecretKeys } from './keys'
export type ClientSecretCreateVariables = {
@@ -23,7 +23,7 @@ export const useClientSecretCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<any, ResponseError, ClientSecretCreateVariables>,
+ UseCustomMutationOptions<any, ResponseError, ClientSecretCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth-secrets/client-secret-delete-mutation.ts b/apps/studio/data/oauth-secrets/client-secret-delete-mutation.ts
index 0b96c249c5d..1fb503cfb87 100644
--- a/apps/studio/data/oauth-secrets/client-secret-delete-mutation.ts
+++ b/apps/studio/data/oauth-secrets/client-secret-delete-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { del, handleError } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { clientSecretKeys } from './keys'
export type ClientSecretDeleteVariables = {
@@ -24,7 +24,7 @@ export const useClientSecretDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<boolean, ResponseError, ClientSecretDeleteVariables>,
+ UseCustomMutationOptions<boolean, ResponseError, ClientSecretDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth-secrets/client-secrets-query.ts b/apps/studio/data/oauth-secrets/client-secrets-query.ts
index 1e29456b08e..4d509d25fa7 100644
--- a/apps/studio/data/oauth-secrets/client-secrets-query.ts
+++ b/apps/studio/data/oauth-secrets/client-secrets-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { clientSecretKeys } from './keys'
import { components } from 'api-types'
@@ -49,7 +49,10 @@ export type ClientSecretsError = ResponseError
export const useClientSecretsQuery = <TData = ClientSecretsData>(
{ slug, appId }: ClientSecretsVariables,
- { enabled = true, ...options }: UseQueryOptions<ClientSecretsData, ClientSecretsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ClientSecretsData, ClientSecretsError, TData> = {}
) =>
useQuery<ClientSecretsData, ClientSecretsError, TData>({
queryKey: clientSecretKeys.list(slug, appId),
diff --git a/apps/studio/data/oauth-server-apps/oauth-server-app-create-mutation.ts b/apps/studio/data/oauth-server-apps/oauth-server-app-create-mutation.ts
index 019e43cb73a..231e5887748 100644
--- a/apps/studio/data/oauth-server-apps/oauth-server-app-create-mutation.ts
+++ b/apps/studio/data/oauth-server-apps/oauth-server-app-create-mutation.ts
@@ -1,9 +1,9 @@
import { CreateOAuthClientParams, SupabaseClient } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthServerAppKeys } from './keys'
export type OAuthServerAppCreateVariables = CreateOAuthClientParams & {
@@ -32,7 +32,7 @@ export const useOAuthServerAppCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OAuthAppCreateData, ResponseError, OAuthServerAppCreateVariables>,
+ UseCustomMutationOptions<OAuthAppCreateData, ResponseError, OAuthServerAppCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth-server-apps/oauth-server-app-delete-mutation.ts b/apps/studio/data/oauth-server-apps/oauth-server-app-delete-mutation.ts
index 460de8fbe6d..c76af7b7621 100644
--- a/apps/studio/data/oauth-server-apps/oauth-server-app-delete-mutation.ts
+++ b/apps/studio/data/oauth-server-apps/oauth-server-app-delete-mutation.ts
@@ -1,9 +1,9 @@
import { SupabaseClient } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthServerAppKeys } from './keys'
export type OAuthServerAppDeleteVariables = {
@@ -34,7 +34,7 @@ export const useOAuthServerAppDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OAuthAppDeleteData, ResponseError, OAuthServerAppDeleteVariables>,
+ UseCustomMutationOptions<OAuthAppDeleteData, ResponseError, OAuthServerAppDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts b/apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts
index e9e4c2c862c..e049ee20e01 100644
--- a/apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts
+++ b/apps/studio/data/oauth-server-apps/oauth-server-app-regenerate-secret-mutation.ts
@@ -1,9 +1,9 @@
import { SupabaseClient } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthServerAppKeys } from './keys'
export type OAuthServerAppRegenerateSecretVariables = {
@@ -34,7 +34,7 @@ export const useOAuthServerAppRegenerateSecretMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OAuthAppRegenerateSecretData,
ResponseError,
OAuthServerAppRegenerateSecretVariables
diff --git a/apps/studio/data/oauth-server-apps/oauth-server-apps-query.ts b/apps/studio/data/oauth-server-apps/oauth-server-apps-query.ts
index 7360db608cc..6b8740f39b2 100644
--- a/apps/studio/data/oauth-server-apps/oauth-server-apps-query.ts
+++ b/apps/studio/data/oauth-server-apps/oauth-server-apps-query.ts
@@ -1,9 +1,9 @@
import { SupabaseClient } from '@supabase/supabase-js'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { oauthServerAppKeys } from './keys'
export type OAuthServerAppsVariables = {
@@ -41,7 +41,7 @@ export const useOAuthServerAppsQuery = <TData = OAuthServerAppsData>(
{
enabled = true,
...options
- }: UseQueryOptions<OAuthServerAppsData, OAuthServerAppsError, TData> = {}
+ }: UseCustomQueryOptions<OAuthServerAppsData, OAuthServerAppsError, TData> = {}
) => {
return useQuery({
queryKey: oauthServerAppKeys.list(projectRef),
diff --git a/apps/studio/data/oauth/authorized-app-revoke-mutation.ts b/apps/studio/data/oauth/authorized-app-revoke-mutation.ts
index 5b9a0a6f353..75f071e7850 100644
--- a/apps/studio/data/oauth/authorized-app-revoke-mutation.ts
+++ b/apps/studio/data/oauth/authorized-app-revoke-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthAppKeys } from './keys'
export type AuthorizedAppRevokeVariables = {
@@ -29,7 +29,7 @@ export const useAuthorizedAppRevokeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AuthorizedAppRevokeData, ResponseError, AuthorizedAppRevokeVariables>,
+ UseCustomMutationOptions<AuthorizedAppRevokeData, ResponseError, AuthorizedAppRevokeVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth/authorized-apps-query.ts b/apps/studio/data/oauth/authorized-apps-query.ts
index a56657ed174..ae2e87a1f10 100644
--- a/apps/studio/data/oauth/authorized-apps-query.ts
+++ b/apps/studio/data/oauth/authorized-apps-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { oauthAppKeys } from './keys'
export type AuthorizedAppsVariables = {
@@ -37,7 +37,7 @@ export const useAuthorizedAppsQuery = <TData = AuthorizedAppsData>(
{
enabled = true,
...options
- }: UseQueryOptions<AuthorizedAppsData, AuthorizedAppsError, TData> = {}
+ }: UseCustomQueryOptions<AuthorizedAppsData, AuthorizedAppsError, TData> = {}
) =>
useQuery<AuthorizedAppsData, AuthorizedAppsError, TData>({
queryKey: oauthAppKeys.authorizedApps(slug),
diff --git a/apps/studio/data/oauth/oauth-app-create-mutation.ts b/apps/studio/data/oauth/oauth-app-create-mutation.ts
index 43b7d495bae..74b0e6c4cc6 100644
--- a/apps/studio/data/oauth/oauth-app-create-mutation.ts
+++ b/apps/studio/data/oauth/oauth-app-create-mutation.ts
@@ -1,10 +1,10 @@
import type { OAuthScope } from '@supabase/shared-types/out/constants'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthAppKeys } from './keys'
export type OAuthAppCreateVariables = {
@@ -48,7 +48,7 @@ export const useOAuthAppCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OAuthAppCreateData, ResponseError, OAuthAppCreateVariables>,
+ UseCustomMutationOptions<OAuthAppCreateData, ResponseError, OAuthAppCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth/oauth-app-delete-mutation.ts b/apps/studio/data/oauth/oauth-app-delete-mutation.ts
index 51adba7fcb6..8f0a2806c35 100644
--- a/apps/studio/data/oauth/oauth-app-delete-mutation.ts
+++ b/apps/studio/data/oauth/oauth-app-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthAppKeys } from './keys'
export type OAuthAppDeleteVariables = {
@@ -29,7 +29,7 @@ export const useOAuthAppDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OAuthAppDeleteData, ResponseError, OAuthAppDeleteVariables>,
+ UseCustomMutationOptions<OAuthAppDeleteData, ResponseError, OAuthAppDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth/oauth-app-update-mutation.ts b/apps/studio/data/oauth/oauth-app-update-mutation.ts
index c533853f84a..230c1038663 100644
--- a/apps/studio/data/oauth/oauth-app-update-mutation.ts
+++ b/apps/studio/data/oauth/oauth-app-update-mutation.ts
@@ -1,9 +1,9 @@
import type { OAuthScope } from '@supabase/shared-types/out/constants'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { oauthAppKeys } from './keys'
export type OAuthAppUpdateVariables = {
@@ -52,7 +52,7 @@ export const useOAuthAppUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OAuthAppUpdateData, ResponseError, OAuthAppUpdateVariables>,
+ UseCustomMutationOptions<OAuthAppUpdateData, ResponseError, OAuthAppUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/oauth/oauth-apps-query.ts b/apps/studio/data/oauth/oauth-apps-query.ts
index 4a9f392b69a..fe63efbc855 100644
--- a/apps/studio/data/oauth/oauth-apps-query.ts
+++ b/apps/studio/data/oauth/oauth-apps-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { oauthAppKeys } from './keys'
export type OAuthAppsVariables = {
@@ -27,7 +27,7 @@ export type OAuthAppsError = ResponseError
export const useOAuthAppsQuery = <TData = OAuthAppsData>(
{ slug }: OAuthAppsVariables,
- { enabled = true, ...options }: UseQueryOptions<OAuthAppsData, OAuthAppsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<OAuthAppsData, OAuthAppsError, TData> = {}
) =>
useQuery<OAuthAppsData, OAuthAppsError, TData>({
queryKey: oauthAppKeys.oauthApps(slug),
diff --git a/apps/studio/data/open-api/api-spec-query.ts b/apps/studio/data/open-api/api-spec-query.ts
index 1fd001a9f32..b8f2a470fdc 100644
--- a/apps/studio/data/open-api/api-spec-query.ts
+++ b/apps/studio/data/open-api/api-spec-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { openApiKeys } from './keys'
export type OpenAPISpecVariables = {
@@ -56,7 +56,10 @@ export type OpenAPISpecError = ResponseError
export const useOpenAPISpecQuery = <TData = OpenAPISpecData>(
{ projectRef }: OpenAPISpecVariables,
- { enabled = true, ...options }: UseQueryOptions<OpenAPISpecData, OpenAPISpecError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<OpenAPISpecData, OpenAPISpecError, TData> = {}
) =>
useQuery<OpenAPISpecData, OpenAPISpecError, TData>({
queryKey: openApiKeys.apiSpec(projectRef),
diff --git a/apps/studio/data/organization-members/organization-invitation-accept-mutation.ts b/apps/studio/data/organization-members/organization-invitation-accept-mutation.ts
index 824c093343a..09764fb4ed3 100644
--- a/apps/studio/data/organization-members/organization-invitation-accept-mutation.ts
+++ b/apps/studio/data/organization-members/organization-invitation-accept-mutation.ts
@@ -1,10 +1,10 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
import { invalidateOrganizationsQuery } from 'data/organizations/organizations-query'
import { useInvalidateProjectsInfiniteQuery } from 'data/projects/org-projects-infinite-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type OrganizationAcceptInvitationVariables = {
slug: string
@@ -30,7 +30,7 @@ export const useOrganizationAcceptInvitationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberUpdateData,
ResponseError,
OrganizationAcceptInvitationVariables
diff --git a/apps/studio/data/organization-members/organization-invitation-create-mutation.ts b/apps/studio/data/organization-members/organization-invitation-create-mutation.ts
index 184f3f2adba..c22c8fe8bcf 100644
--- a/apps/studio/data/organization-members/organization-invitation-create-mutation.ts
+++ b/apps/studio/data/organization-members/organization-invitation-create-mutation.ts
@@ -1,10 +1,10 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
import { organizationKeys as organizationKeysV1 } from 'data/organizations/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationCreateInvitationVariables = {
@@ -39,7 +39,7 @@ export const useOrganizationCreateInvitationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberUpdateData,
ResponseError,
OrganizationCreateInvitationVariables
diff --git a/apps/studio/data/organization-members/organization-invitation-delete-mutation.ts b/apps/studio/data/organization-members/organization-invitation-delete-mutation.ts
index eef180c15b3..30382c0e918 100644
--- a/apps/studio/data/organization-members/organization-invitation-delete-mutation.ts
+++ b/apps/studio/data/organization-members/organization-invitation-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys as organizationKeysV1 } from '../organizations/keys'
import { organizationKeys } from './keys'
@@ -31,7 +31,7 @@ export const useOrganizationDeleteInvitationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationDeleteInvitationData,
ResponseError,
OrganizationDeleteInvitationVariables
diff --git a/apps/studio/data/organization-members/organization-invitation-token-query.ts b/apps/studio/data/organization-members/organization-invitation-token-query.ts
index e65cc45b73e..5d59fb11a4f 100644
--- a/apps/studio/data/organization-members/organization-invitation-token-query.ts
+++ b/apps/studio/data/organization-members/organization-invitation-token-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
-import { components } from 'api-types'
export type OrganizationInviteTokenVariables = { slug?: string; token?: string }
@@ -33,7 +33,7 @@ export const useOrganizationInvitationTokenQuery = <TData = OrganizationInviteTo
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationInviteTokenData, OrganizationInviteTokenError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationInviteTokenData, OrganizationInviteTokenError, TData> = {}
) => {
return useQuery<OrganizationInviteTokenData, OrganizationInviteTokenError, TData>({
queryKey: organizationKeys.token(slug, token),
diff --git a/apps/studio/data/organization-members/organization-member-role-assign-mutation.ts b/apps/studio/data/organization-members/organization-member-role-assign-mutation.ts
index 80a9ee5567e..690b962cbb4 100644
--- a/apps/studio/data/organization-members/organization-member-role-assign-mutation.ts
+++ b/apps/studio/data/organization-members/organization-member-role-assign-mutation.ts
@@ -1,10 +1,10 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, patch } from 'data/fetchers'
import { organizationKeys as organizationKeysV1 } from 'data/organizations/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMemberAssignRoleVariables = {
@@ -41,7 +41,7 @@ export const useOrganizationMemberAssignRoleMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberAssignData,
ResponseError,
OrganizationMemberAssignRoleVariables
diff --git a/apps/studio/data/organization-members/organization-member-role-unassign-mutation.ts b/apps/studio/data/organization-members/organization-member-role-unassign-mutation.ts
index 593013f5183..a7afc010eb3 100644
--- a/apps/studio/data/organization-members/organization-member-role-unassign-mutation.ts
+++ b/apps/studio/data/organization-members/organization-member-role-unassign-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import { organizationKeys as organizationKeysV1 } from 'data/organizations/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMemberUnassignRoleVariables = {
@@ -42,7 +42,7 @@ export const useOrganizationMemberUnassignRoleMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberUnassignRoleData,
ResponseError,
OrganizationMemberUnassignRoleVariables
diff --git a/apps/studio/data/organization-members/organization-member-role-update-mutation.ts b/apps/studio/data/organization-members/organization-member-role-update-mutation.ts
index 8e52a5aa9d1..a964d973783 100644
--- a/apps/studio/data/organization-members/organization-member-role-update-mutation.ts
+++ b/apps/studio/data/organization-members/organization-member-role-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
import { organizationKeys as organizationKeysV1 } from 'data/organizations/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMemberUpdateRoleVariables = {
@@ -41,7 +41,7 @@ export const useOrganizationMemberUpdateRoleMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberAssignData,
ResponseError,
OrganizationMemberUpdateRoleVariables
diff --git a/apps/studio/data/organization-members/organization-roles-query.ts b/apps/studio/data/organization-members/organization-roles-query.ts
index 1085ee8b73b..e6c7ae46c22 100644
--- a/apps/studio/data/organization-members/organization-roles-query.ts
+++ b/apps/studio/data/organization-members/organization-roles-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export const FIXED_ROLE_ORDER = ['Owner', 'Administrator', 'Developer', 'Read-only']
@@ -34,7 +34,7 @@ export const useOrganizationRolesV2Query = <TData = OrganizationRolesData>(
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationRolesData, OrganizationRolesError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationRolesData, OrganizationRolesError, TData> = {}
) =>
useQuery<OrganizationRolesData, OrganizationRolesError, TData>({
queryKey: organizationKeys.rolesV2(slug),
diff --git a/apps/studio/data/organizations/free-project-limit-check-query.ts b/apps/studio/data/organizations/free-project-limit-check-query.ts
index 1b37ebb8833..cbe0e24118e 100644
--- a/apps/studio/data/organizations/free-project-limit-check-query.ts
+++ b/apps/studio/data/organizations/free-project-limit-check-query.ts
@@ -1,8 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { organizationKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type MemberWithFreeProjectLimit = components['schemas']['MemberWithFreeProjectLimit']
@@ -36,7 +37,7 @@ export const useFreeProjectLimitCheckQuery = <TData = FreeProjectLimitCheckData>
{
enabled = true,
...options
- }: UseQueryOptions<FreeProjectLimitCheckData, FreeProjectLimitCheckError, TData> = {}
+ }: UseCustomQueryOptions<FreeProjectLimitCheckData, FreeProjectLimitCheckError, TData> = {}
) =>
useQuery<FreeProjectLimitCheckData, FreeProjectLimitCheckError, TData>({
queryKey: organizationKeys.freeProjectLimitCheck(slug),
diff --git a/apps/studio/data/organizations/organization-audit-logs-query.ts b/apps/studio/data/organizations/organization-audit-logs-query.ts
index 0be36991c7a..1701003f185 100644
--- a/apps/studio/data/organizations/organization-audit-logs-query.ts
+++ b/apps/studio/data/organizations/organization-audit-logs-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type AuditLog = {
@@ -64,7 +64,7 @@ export const useOrganizationAuditLogsQuery = <TData = OrganizationAuditLogsData>
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationAuditLogsData, OrganizationAuditLogsError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationAuditLogsData, OrganizationAuditLogsError, TData> = {}
) => {
const { slug, iso_timestamp_start, iso_timestamp_end } = vars
diff --git a/apps/studio/data/organizations/organization-available-regions-query.ts b/apps/studio/data/organizations/organization-available-regions-query.ts
index 7d037845ae9..594880ec61e 100644
--- a/apps/studio/data/organizations/organization-available-regions-query.ts
+++ b/apps/studio/data/organizations/organization-available-regions-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { operations } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type DesiredInstanceSizeForAvailableRegions =
@@ -44,7 +44,7 @@ export const useOrganizationAvailableRegionsQuery = <TData = OrganizationAvailab
{
enabled = true,
...options
- }: UseQueryOptions<
+ }: UseCustomQueryOptions<
OrganizationAvailableRegionsData,
OrganizationAvailableRegionsError,
TData
diff --git a/apps/studio/data/organizations/organization-billing-subscription-preview.ts b/apps/studio/data/organizations/organization-billing-subscription-preview.ts
index cf667a8b6f1..e8e2e2d4903 100644
--- a/apps/studio/data/organizations/organization-billing-subscription-preview.ts
+++ b/apps/studio/data/organizations/organization-billing-subscription-preview.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
import type { SubscriptionTier } from 'data/subscriptions/types'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationBillingSubscriptionPreviewVariables = {
@@ -81,7 +81,7 @@ export const useOrganizationBillingSubscriptionPreview = <
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationBillingSubscriptionPreviewData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationBillingSubscriptionPreviewData, ResponseError, TData> = {}
) =>
useQuery<OrganizationBillingSubscriptionPreviewData, ResponseError, TData>({
queryKey: organizationKeys.subscriptionPreview(organizationSlug, tier),
diff --git a/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts b/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts
index 4e015facf5e..a93098c48d7 100644
--- a/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts
+++ b/apps/studio/data/organizations/organization-by-fly-organization-id-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type OrganizationByFlyOrgIdVariables = {
flyOrganizationId: string
@@ -28,7 +28,11 @@ export const useOrganizationByFlyOrgIdMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationByFlyOrgIdData, ResponseError, OrganizationByFlyOrgIdVariables>,
+ UseCustomMutationOptions<
+ OrganizationByFlyOrgIdData,
+ ResponseError,
+ OrganizationByFlyOrgIdVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<OrganizationByFlyOrgIdData, ResponseError, OrganizationByFlyOrgIdVariables>({
diff --git a/apps/studio/data/organizations/organization-create-mutation.ts b/apps/studio/data/organizations/organization-create-mutation.ts
index cab7a6b97fb..f18a8bf2f80 100644
--- a/apps/studio/data/organizations/organization-create-mutation.ts
+++ b/apps/studio/data/organizations/organization-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
import { permissionKeys } from 'data/permissions/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
import { castOrganizationResponseToOrganization } from './organizations-query'
import type { CustomerAddress, CustomerTaxId } from './types'
@@ -53,7 +53,7 @@ export const useOrganizationCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationCreateData, ResponseError, OrganizationCreateVariables>,
+ UseCustomMutationOptions<OrganizationCreateData, ResponseError, OrganizationCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
@@ -125,7 +125,7 @@ export const useAwsManagedOrganizationCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
AwsManagedOrganizationCreateData,
ResponseError,
AwsManagedOrganizationCreateVariables
diff --git a/apps/studio/data/organizations/organization-credit-top-up-mutation.ts b/apps/studio/data/organizations/organization-credit-top-up-mutation.ts
index 7e8e984b3da..b39996ab60f 100644
--- a/apps/studio/data/organizations/organization-credit-top-up-mutation.ts
+++ b/apps/studio/data/organizations/organization-credit-top-up-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import type { CustomerAddress, CustomerTaxId } from './types'
export type OrganizationCreditTopUpVariables = {
@@ -64,7 +64,11 @@ export const useOrganizationCreditTopUpMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationTaxIdUpdateData, ResponseError, OrganizationCreditTopUpVariables>,
+ UseCustomMutationOptions<
+ OrganizationTaxIdUpdateData,
+ ResponseError,
+ OrganizationCreditTopUpVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<OrganizationTaxIdUpdateData, ResponseError, OrganizationCreditTopUpVariables>({
diff --git a/apps/studio/data/organizations/organization-customer-profile-query.ts b/apps/studio/data/organizations/organization-customer-profile-query.ts
index 8545bba1794..da637ca5dc7 100644
--- a/apps/studio/data/organizations/organization-customer-profile-query.ts
+++ b/apps/studio/data/organizations/organization-customer-profile-query.ts
@@ -1,11 +1,11 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { IS_PLATFORM } from 'common'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
-import { IS_PLATFORM } from 'common'
export type OrganizationCustomerProfileVariables = {
slug?: string
@@ -40,7 +40,11 @@ export const useOrganizationCustomerProfileQuery = <TData = OrganizationCustomer
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationCustomerProfileData, OrganizationCustomerProfileError, TData> = {}
+ }: UseCustomQueryOptions<
+ OrganizationCustomerProfileData,
+ OrganizationCustomerProfileError,
+ TData
+ > = {}
) => {
// [Joshen] Thinking it makes sense to add this check at the RQ level - prevent
// unnecessary requests, although this behaviour still needs handling on the UI
diff --git a/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts b/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts
index f396cae3352..bc7507948ca 100644
--- a/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts
+++ b/apps/studio/data/organizations/organization-customer-profile-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
import type { CustomerAddress } from './types'
@@ -43,7 +43,7 @@ export const useOrganizationCustomerProfileUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationCustomerProfileUpdateData,
ResponseError,
OrganizationCustomerProfileUpdateVariables
diff --git a/apps/studio/data/organizations/organization-delete-mutation.ts b/apps/studio/data/organizations/organization-delete-mutation.ts
index e303cbdc374..d825d20b937 100644
--- a/apps/studio/data/organizations/organization-delete-mutation.ts
+++ b/apps/studio/data/organizations/organization-delete-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import { permissionKeys } from 'data/permissions/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationDeleteVariables = {
@@ -25,7 +25,7 @@ export const useOrganizationDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationDeleteData, ResponseError, OrganizationDeleteVariables>,
+ UseCustomMutationOptions<OrganizationDeleteData, ResponseError, OrganizationDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/organizations/organization-link-aws-marketplace-mutation.ts b/apps/studio/data/organizations/organization-link-aws-marketplace-mutation.ts
index 829ae1c2432..79e3cbd7671 100644
--- a/apps/studio/data/organizations/organization-link-aws-marketplace-mutation.ts
+++ b/apps/studio/data/organizations/organization-link-aws-marketplace-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
+import type { ResponseError, UseCustomMutationOptions } from '../../types'
import { handleError, put } from '../fetchers'
-import type { ResponseError } from '../../types'
export type OrganizationLinkAwsMarketplaceVariables = {
buyerId: string
@@ -29,7 +29,11 @@ export const useOrganizationLinkAwsMarketplaceMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<LinkOrganizationData, ResponseError, OrganizationLinkAwsMarketplaceVariables>,
+ UseCustomMutationOptions<
+ LinkOrganizationData,
+ ResponseError,
+ OrganizationLinkAwsMarketplaceVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<LinkOrganizationData, ResponseError, OrganizationLinkAwsMarketplaceVariables>({
diff --git a/apps/studio/data/organizations/organization-member-delete-mutation.ts b/apps/studio/data/organizations/organization-member-delete-mutation.ts
index dc4a9e0f0e5..cdff3635248 100644
--- a/apps/studio/data/organizations/organization-member-delete-mutation.ts
+++ b/apps/studio/data/organizations/organization-member-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMemberDeleteVariables = {
@@ -28,7 +28,7 @@ export const useOrganizationMemberDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationMemberDeleteData,
ResponseError,
OrganizationMemberDeleteVariables
diff --git a/apps/studio/data/organizations/organization-members-query.ts b/apps/studio/data/organizations/organization-members-query.ts
index 444c3580ee2..6cc5cf0edf7 100644
--- a/apps/studio/data/organizations/organization-members-query.ts
+++ b/apps/studio/data/organizations/organization-members-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMembersVariables = {
@@ -58,7 +58,7 @@ export const useOrganizationMembersQuery = <TData = OrganizationMembersData>(
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationMembersData, OrganizationMembersError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationMembersData, OrganizationMembersError, TData> = {}
) =>
useQuery<OrganizationMembersData, OrganizationMembersError, TData>({
queryKey: organizationKeys.members(slug),
diff --git a/apps/studio/data/organizations/organization-mfa-mutation.ts b/apps/studio/data/organizations/organization-mfa-mutation.ts
index b0e964d6a7f..b07fbb5c666 100644
--- a/apps/studio/data/organizations/organization-mfa-mutation.ts
+++ b/apps/studio/data/organizations/organization-mfa-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
-import { patch, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import { handleError, patch } from 'data/fetchers'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMfaToggleVariables = {
@@ -29,7 +29,11 @@ export const useOrganizationMfaToggleMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationMfaToggleData, ResponseError, OrganizationMfaToggleVariables>,
+ UseCustomMutationOptions<
+ OrganizationMfaToggleData,
+ ResponseError,
+ OrganizationMfaToggleVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/organizations/organization-mfa-query.ts b/apps/studio/data/organizations/organization-mfa-query.ts
index 0105816198e..cd847011bb9 100644
--- a/apps/studio/data/organizations/organization-mfa-query.ts
+++ b/apps/studio/data/organizations/organization-mfa-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationMfaVariables = {
@@ -29,7 +29,7 @@ export type OrganizationMfaError = ResponseError
export const useOrganizationMfaQuery = <TData = boolean>(
{ slug }: OrganizationMfaVariables,
- { enabled = true, ...options }: UseQueryOptions<boolean, OrganizationMfaError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<boolean, OrganizationMfaError, TData> = {}
) =>
useQuery<boolean, OrganizationMfaError, TData>({
queryKey: organizationKeys.mfa(slug),
diff --git a/apps/studio/data/organizations/organization-payment-method-default-mutation.ts b/apps/studio/data/organizations/organization-payment-method-default-mutation.ts
index fd0b6f1c2d7..a513308853c 100644
--- a/apps/studio/data/organizations/organization-payment-method-default-mutation.ts
+++ b/apps/studio/data/organizations/organization-payment-method-default-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, put } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationPaymentMethodDefaultVariables = {
@@ -34,7 +34,7 @@ export const useOrganizationPaymentMethodMarkAsDefaultMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationPaymentMethodDefaultData,
ResponseError,
OrganizationPaymentMethodDefaultVariables
diff --git a/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts b/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts
index 35cc15ed959..628f0c79047 100644
--- a/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts
+++ b/apps/studio/data/organizations/organization-payment-method-delete-mutation.ts
@@ -1,7 +1,7 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { del, handleError } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationPaymentMethodDeleteVariables = {
@@ -35,7 +35,7 @@ export const useOrganizationPaymentMethodDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationPaymentMethodDeleteData,
ResponseError,
OrganizationPaymentMethodDeleteVariables
diff --git a/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts b/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts
index 044ef993f3c..fc1a245d289 100644
--- a/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts
+++ b/apps/studio/data/organizations/organization-payment-method-setup-intent-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type OrganizationPaymentMethodSetupIntentVariables = {
slug: string
@@ -30,7 +30,7 @@ export const useOrganizationPaymentMethodSetupIntent = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
OrganizationPaymentMethodSetupIntentData,
ResponseError,
OrganizationPaymentMethodSetupIntentVariables
diff --git a/apps/studio/data/organizations/organization-payment-methods-query.ts b/apps/studio/data/organizations/organization-payment-methods-query.ts
index a2571a3ddb2..f346893e6fd 100644
--- a/apps/studio/data/organizations/organization-payment-methods-query.ts
+++ b/apps/studio/data/organizations/organization-payment-methods-query.ts
@@ -1,10 +1,10 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationPaymentMethodsVariables = { slug?: string }
@@ -42,7 +42,11 @@ export const useOrganizationPaymentMethodsQuery = <TData = OrganizationPaymentMe
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationPaymentMethodsData, OrganizationPaymentMethodsError, TData> = {}
+ }: UseCustomQueryOptions<
+ OrganizationPaymentMethodsData,
+ OrganizationPaymentMethodsError,
+ TData
+ > = {}
) => {
const { can: canReadSubscriptions } = useAsyncCheckPermissions(
PermissionAction.BILLING_READ,
diff --git a/apps/studio/data/organizations/organization-project-claim-mutation.ts b/apps/studio/data/organizations/organization-project-claim-mutation.ts
index 9a3e7223e81..3598be82d21 100644
--- a/apps/studio/data/organizations/organization-project-claim-mutation.ts
+++ b/apps/studio/data/organizations/organization-project-claim-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type OrganizationProjectClaimVariables = {
slug: string
@@ -24,7 +24,7 @@ export const useOrganizationProjectClaimMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
ClaimOrganizationProjectData,
ResponseError,
OrganizationProjectClaimVariables
diff --git a/apps/studio/data/organizations/organization-project-claim-query.ts b/apps/studio/data/organizations/organization-project-claim-query.ts
index c8abadb23bd..7b86012b2a8 100644
--- a/apps/studio/data/organizations/organization-project-claim-query.ts
+++ b/apps/studio/data/organizations/organization-project-claim-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
-import { organizationKeys } from './keys'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
+import { organizationKeys } from './keys'
type OrganizationProjectClaimVariables = {
slug: string
@@ -67,7 +67,7 @@ export const useOrganizationProjectClaimQuery = <TData = OrganizationProjectClai
{ slug, token }: OrganizationProjectClaimVariables,
{
...options
- }: UseQueryOptions<OrganizationProjectClaimData, OrganizationProjectClaimError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationProjectClaimData, OrganizationProjectClaimError, TData> = {}
) =>
useQuery<OrganizationProjectClaimData, OrganizationProjectClaimError, TData>({
queryKey: organizationKeys.projectClaim(slug, token),
diff --git a/apps/studio/data/organizations/organization-query.ts b/apps/studio/data/organizations/organization-query.ts
index fe46fab8676..7a999f31b62 100644
--- a/apps/studio/data/organizations/organization-query.ts
+++ b/apps/studio/data/organizations/organization-query.ts
@@ -1,8 +1,8 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationVariables = { slug?: string }
@@ -35,7 +35,10 @@ export type OrganizationsError = ResponseError
export const useOrganizationQuery = <TData = OrganizationsData>(
{ slug }: OrganizationVariables,
- { enabled = true, ...options }: UseQueryOptions<OrganizationsData, OrganizationsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<OrganizationsData, OrganizationsError, TData> = {}
) => {
return useQuery<OrganizationsData, OrganizationsError, TData>({
queryKey: organizationKeys.detail(slug),
diff --git a/apps/studio/data/organizations/organization-tax-id-query.ts b/apps/studio/data/organizations/organization-tax-id-query.ts
index fe4ea3ab0a3..19e148b9ebc 100644
--- a/apps/studio/data/organizations/organization-tax-id-query.ts
+++ b/apps/studio/data/organizations/organization-tax-id-query.ts
@@ -1,10 +1,10 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationTaxIdVariables = {
@@ -34,7 +34,7 @@ export const useOrganizationTaxIdQuery = <TData = OrganizationTaxIdData>(
{
enabled = true,
...options
- }: UseQueryOptions<OrganizationTaxIdData, OrganizationTaxIdError, TData> = {}
+ }: UseCustomQueryOptions<OrganizationTaxIdData, OrganizationTaxIdError, TData> = {}
) => {
const { can: canReadSubscriptions } = useAsyncCheckPermissions(
PermissionAction.BILLING_READ,
diff --git a/apps/studio/data/organizations/organization-tax-id-update-mutation.ts b/apps/studio/data/organizations/organization-tax-id-update-mutation.ts
index 2feea64e7d4..19d1a1dc9d7 100644
--- a/apps/studio/data/organizations/organization-tax-id-update-mutation.ts
+++ b/apps/studio/data/organizations/organization-tax-id-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationTaxIdUpdateVariables = {
@@ -54,7 +54,11 @@ export const useOrganizationTaxIdUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationTaxIdUpdateData, ResponseError, OrganizationTaxIdUpdateVariables>,
+ UseCustomMutationOptions<
+ OrganizationTaxIdUpdateData,
+ ResponseError,
+ OrganizationTaxIdUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/organizations/organization-update-mutation.ts b/apps/studio/data/organizations/organization-update-mutation.ts
index 81a22616fd3..272d332bd43 100644
--- a/apps/studio/data/organizations/organization-update-mutation.ts
+++ b/apps/studio/data/organizations/organization-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { organizationKeys } from './keys'
export type OrganizationUpdateVariables = {
@@ -44,7 +44,7 @@ export const useOrganizationUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrganizationUpdateData, ResponseError, OrganizationUpdateVariables>,
+ UseCustomMutationOptions<OrganizationUpdateData, ResponseError, OrganizationUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/organizations/organizations-query.ts b/apps/studio/data/organizations/organizations-query.ts
index c0898ea2c3e..88c29412143 100644
--- a/apps/studio/data/organizations/organizations-query.ts
+++ b/apps/studio/data/organizations/organizations-query.ts
@@ -1,11 +1,11 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
+import { MANAGED_BY, ManagedBy } from 'lib/constants/infrastructure'
import { useProfile } from 'lib/profile'
-import type { Organization, ResponseError } from 'types'
+import type { Organization, ResponseError, UseCustomQueryOptions } from 'types'
import { organizationKeys } from './keys'
-import { MANAGED_BY, ManagedBy } from 'lib/constants/infrastructure'
export type OrganizationBase = components['schemas']['OrganizationResponse']
@@ -52,7 +52,7 @@ export type OrganizationsError = ResponseError
export const useOrganizationsQuery = <TData = OrganizationsData>({
enabled = true,
...options
-}: UseQueryOptions<OrganizationsData, OrganizationsError, TData> = {}) => {
+}: UseCustomQueryOptions<OrganizationsData, OrganizationsError, TData> = {}) => {
const { profile } = useProfile()
return useQuery<OrganizationsData, OrganizationsError, TData>({
queryKey: organizationKeys.list(),
diff --git a/apps/studio/data/permissions/permissions-query.ts b/apps/studio/data/permissions/permissions-query.ts
index 875a823ee5a..6e47549e96b 100644
--- a/apps/studio/data/permissions/permissions-query.ts
+++ b/apps/studio/data/permissions/permissions-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { useIsLoggedIn } from 'common'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { Permission, ResponseError } from 'types'
+import type { Permission, ResponseError, UseCustomQueryOptions } from 'types'
import { permissionKeys } from './keys'
export type PermissionsResponse = Permission[]
@@ -33,7 +33,7 @@ export type PermissionsError = ResponseError
export const usePermissionsQuery = <TData = PermissionsData>({
enabled = true,
...options
-}: UseQueryOptions<PermissionsData, PermissionsError, TData> = {}) => {
+}: UseCustomQueryOptions<PermissionsData, PermissionsError, TData> = {}) => {
const isLoggedIn = useIsLoggedIn()
return useQuery<PermissionsData, PermissionsError, TData>({
diff --git a/apps/studio/data/platform/platform-status-query.ts b/apps/studio/data/platform/platform-status-query.ts
index fb92d2e154f..73f944673bf 100644
--- a/apps/studio/data/platform/platform-status-query.ts
+++ b/apps/studio/data/platform/platform-status-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { platformKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type PlatformStatusResponse = {
isHealthy: boolean
@@ -17,7 +18,7 @@ export type PlatformStatusData = Awaited<ReturnType<typeof getPlatformStatus>>
export type PlatformStatusError = unknown
export const usePlatformStatusQuery = <TData = PlatformStatusData>(
- options: UseQueryOptions<PlatformStatusData, PlatformStatusError, TData> = {}
+ options: UseCustomQueryOptions<PlatformStatusData, PlatformStatusError, TData> = {}
) =>
useQuery<PlatformStatusData, PlatformStatusError, TData>({
queryKey: platformKeys.status(),
diff --git a/apps/studio/data/privileges/column-privileges-grant-mutation.ts b/apps/studio/data/privileges/column-privileges-grant-mutation.ts
index 31c485675b6..412b9950c97 100644
--- a/apps/studio/data/privileges/column-privileges-grant-mutation.ts
+++ b/apps/studio/data/privileges/column-privileges-grant-mutation.ts
@@ -1,8 +1,8 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { privilegeKeys } from './keys'
export type ColumnPrivilegesGrant = {
@@ -49,7 +49,11 @@ export const useColumnPrivilegesGrantMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ColumnPrivilegesGrantData, ResponseError, ColumnPrivilegesGrantVariables>,
+ UseCustomMutationOptions<
+ ColumnPrivilegesGrantData,
+ ResponseError,
+ ColumnPrivilegesGrantVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/privileges/column-privileges-query.ts b/apps/studio/data/privileges/column-privileges-query.ts
index b9d3d866778..7f9ec099832 100644
--- a/apps/studio/data/privileges/column-privileges-query.ts
+++ b/apps/studio/data/privileges/column-privileges-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { privilegeKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type ColumnPrivilegesVariables = {
projectRef?: string
@@ -47,7 +47,7 @@ export const useColumnPrivilegesQuery = <TData = ColumnPrivilegesData>(
{
enabled = true,
...options
- }: UseQueryOptions<ColumnPrivilegesData, ColumnPrivilegesError, TData> = {}
+ }: UseCustomQueryOptions<ColumnPrivilegesData, ColumnPrivilegesError, TData> = {}
) =>
useQuery<ColumnPrivilegesData, ColumnPrivilegesError, TData>({
queryKey: privilegeKeys.columnPrivilegesList(projectRef),
diff --git a/apps/studio/data/privileges/column-privileges-revoke-mutation.ts b/apps/studio/data/privileges/column-privileges-revoke-mutation.ts
index bffbb295427..578f5d25da6 100644
--- a/apps/studio/data/privileges/column-privileges-revoke-mutation.ts
+++ b/apps/studio/data/privileges/column-privileges-revoke-mutation.ts
@@ -1,8 +1,8 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { privilegeKeys } from './keys'
export type ColumnPrivilegesRevoke = {
@@ -47,7 +47,11 @@ export const useColumnPrivilegesRevokeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ColumnPrivilegesRevokeData, ResponseError, ColumnPrivilegesRevokeVariables>,
+ UseCustomMutationOptions<
+ ColumnPrivilegesRevokeData,
+ ResponseError,
+ ColumnPrivilegesRevokeVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/privileges/table-privileges-grant-mutation.ts b/apps/studio/data/privileges/table-privileges-grant-mutation.ts
index 8347e44c1ea..321d97a3609 100644
--- a/apps/studio/data/privileges/table-privileges-grant-mutation.ts
+++ b/apps/studio/data/privileges/table-privileges-grant-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { privilegeKeys } from './keys'
import { invalidateTablePrivilegesQuery } from './table-privileges-query'
@@ -41,7 +41,7 @@ export const useTablePrivilegesGrantMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TablePrivilegesGrantData, ResponseError, TablePrivilegesGrantVariables>,
+ UseCustomMutationOptions<TablePrivilegesGrantData, ResponseError, TablePrivilegesGrantVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/privileges/table-privileges-query.ts b/apps/studio/data/privileges/table-privileges-query.ts
index 9d872e65436..9033eeda575 100644
--- a/apps/studio/data/privileges/table-privileges-query.ts
+++ b/apps/studio/data/privileges/table-privileges-query.ts
@@ -1,9 +1,10 @@
import pgMeta from '@supabase/pg-meta'
-import { QueryClient, UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { z } from 'zod'
import { executeSql, ExecuteSqlError } from 'data/sql/execute-sql-query'
import { privilegeKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type TablePrivilegesVariables = {
projectRef?: string
@@ -39,7 +40,7 @@ export const useTablePrivilegesQuery = <TData = TablePrivilegesData>(
{
enabled = true,
...options
- }: UseQueryOptions<TablePrivilegesData, TablePrivilegesError, TData> = {}
+ }: UseCustomQueryOptions<TablePrivilegesData, TablePrivilegesError, TData> = {}
) =>
useQuery<TablePrivilegesData, TablePrivilegesError, TData>({
queryKey: privilegeKeys.tablePrivilegesList(projectRef),
diff --git a/apps/studio/data/privileges/table-privileges-revoke-mutation.ts b/apps/studio/data/privileges/table-privileges-revoke-mutation.ts
index 5f0e9c4d760..bd886179f39 100644
--- a/apps/studio/data/privileges/table-privileges-revoke-mutation.ts
+++ b/apps/studio/data/privileges/table-privileges-revoke-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { privilegeKeys } from './keys'
import { invalidateTablePrivilegesQuery } from './table-privileges-query'
@@ -41,7 +41,11 @@ export const useTablePrivilegesRevokeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TablePrivilegesRevokeData, ResponseError, TablePrivilegesRevokeVariables>,
+ UseCustomMutationOptions<
+ TablePrivilegesRevokeData,
+ ResponseError,
+ TablePrivilegesRevokeVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts b/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts
index ec2f78ca863..5e7a797c36d 100644
--- a/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts
+++ b/apps/studio/data/profile/mfa-authenticator-assurance-level-query.ts
@@ -1,8 +1,9 @@
import type { AuthMFAGetAuthenticatorAssuranceLevelResponse } from '@supabase/supabase-js'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { profileKeys } from './keys'
import type { Profile } from './types'
+import { UseCustomQueryOptions } from 'types'
export type ProfileResponse = Profile
@@ -25,7 +26,7 @@ export const useAuthenticatorAssuranceLevelQuery = <
>({
enabled = true,
...options
-}: UseQueryOptions<
+}: UseCustomQueryOptions<
CustomAuthMFAGetAuthenticatorAssuranceLevelData,
CustomAuthMFAGetAuthenticatorAssuranceLevelError,
TData
diff --git a/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts b/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts
index 2bac6e111e5..6cb56b6a441 100644
--- a/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts
+++ b/apps/studio/data/profile/mfa-challenge-and-verify-mutation.ts
@@ -1,10 +1,11 @@
import * as Sentry from '@sentry/nextjs'
import type { AuthMFAVerifyResponse, MFAChallengeAndVerifyParams } from '@supabase/supabase-js'
-import { UseMutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { auth } from 'lib/gotrue'
import { profileKeys } from './keys'
+import { UseCustomMutationOptions } from 'types'
const WHITELIST_ERRORS = ['Invalid TOTP code entered']
@@ -26,7 +27,11 @@ export const useMfaChallengeAndVerifyMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomMFAVerifyResponse, CustomMFAVerifyError, MFAChallengeAndVerifyVariables>,
+ UseCustomMutationOptions<
+ CustomMFAVerifyResponse,
+ CustomMFAVerifyError,
+ MFAChallengeAndVerifyVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/profile/mfa-enroll-mutation.ts b/apps/studio/data/profile/mfa-enroll-mutation.ts
index 220974b50a2..31cc58291f4 100644
--- a/apps/studio/data/profile/mfa-enroll-mutation.ts
+++ b/apps/studio/data/profile/mfa-enroll-mutation.ts
@@ -1,7 +1,8 @@
import type { AuthMFAEnrollResponse, MFAEnrollParams } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { toast } from 'sonner'
+import { UseCustomMutationOptions } from 'types'
const mfaEnroll = async (params: MFAEnrollParams) => {
const { error, data } = await auth.mfa.enroll(params)
@@ -18,7 +19,7 @@ export const useMfaEnrollMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomMFAEnrollResponse, CustomMFAEnrollError, MFAEnrollParams>,
+ UseCustomMutationOptions<CustomMFAEnrollResponse, CustomMFAEnrollError, MFAEnrollParams>,
'mutationFn'
> = {}) => {
return useMutation({
diff --git a/apps/studio/data/profile/mfa-list-factors-query.ts b/apps/studio/data/profile/mfa-list-factors-query.ts
index 6e3ade9fd05..fd234db75de 100644
--- a/apps/studio/data/profile/mfa-list-factors-query.ts
+++ b/apps/studio/data/profile/mfa-list-factors-query.ts
@@ -1,7 +1,8 @@
import type { AuthMFAListFactorsResponse, Factor } from '@supabase/supabase-js'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { profileKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export async function getMfaListFactors() {
const { error, data } = await auth.mfa.listFactors()
@@ -17,7 +18,7 @@ type CustomMFAListFactorsError = NonNullable<AuthMFAListFactorsResponse['error']
export const useMfaListFactorsQuery = <TData = CustomMFAListFactorsData>({
enabled = true,
...options
-}: UseQueryOptions<CustomMFAListFactorsData, CustomMFAListFactorsError, TData> = {}) => {
+}: UseCustomQueryOptions<CustomMFAListFactorsData, CustomMFAListFactorsError, TData> = {}) => {
return useQuery<CustomMFAListFactorsData, CustomMFAListFactorsError, TData>({
queryKey: profileKeys.mfaFactors(),
queryFn: () => getMfaListFactors(),
diff --git a/apps/studio/data/profile/mfa-unenroll-mutation.ts b/apps/studio/data/profile/mfa-unenroll-mutation.ts
index a94fe258249..fa6d206ff0b 100644
--- a/apps/studio/data/profile/mfa-unenroll-mutation.ts
+++ b/apps/studio/data/profile/mfa-unenroll-mutation.ts
@@ -1,8 +1,9 @@
import type { AuthMFAUnenrollResponse, MFAUnenrollParams } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { toast } from 'sonner'
import { profileKeys } from './keys'
+import { UseCustomMutationOptions } from 'types'
const mfaUnenroll = async (params: MFAUnenrollParams) => {
const { error, data } = await auth.mfa.unenroll(params)
@@ -19,7 +20,7 @@ export const useMfaUnenrollMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CustomMFAUnenrollResponse, CustomMFAUnenrollError, MFAUnenrollParams>,
+ UseCustomMutationOptions<CustomMFAUnenrollResponse, CustomMFAUnenrollError, MFAUnenrollParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/profile/profile-audit-logs-query.ts b/apps/studio/data/profile/profile-audit-logs-query.ts
index 209179d2fd1..4164b00a51d 100644
--- a/apps/studio/data/profile/profile-audit-logs-query.ts
+++ b/apps/studio/data/profile/profile-audit-logs-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import type { AuditLog } from 'data/organizations/organization-audit-logs-query'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { profileKeys } from './keys'
export type ProfileAuditLogsVariables = {
@@ -37,7 +37,7 @@ export type ProfileAuditLogsData = {
export const useProfileAuditLogsQuery = <TData = ProfileAuditLogsData>(
vars: ProfileAuditLogsVariables,
- options: UseQueryOptions<ProfileAuditLogsData, ProfileAuditLogsError, TData> = {}
+ options: UseCustomQueryOptions<ProfileAuditLogsData, ProfileAuditLogsError, TData> = {}
) => {
const { iso_timestamp_start, iso_timestamp_end } = vars
return useQuery<ProfileAuditLogsData, ProfileAuditLogsError, TData>({
diff --git a/apps/studio/data/profile/profile-create-mutation.ts b/apps/studio/data/profile/profile-create-mutation.ts
index b49484fd05e..98809a35579 100644
--- a/apps/studio/data/profile/profile-create-mutation.ts
+++ b/apps/studio/data/profile/profile-create-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
import { organizationKeys } from 'data/organizations/keys'
import { permissionKeys } from 'data/permissions/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { profileKeys } from './keys'
export type ProfileResponse = components['schemas']['ProfileResponse']
@@ -23,7 +23,7 @@ export const useProfileCreateMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<ProfileCreateData, ResponseError, void>, 'mutationFn'> = {}) => {
+}: Omit<UseCustomMutationOptions<ProfileCreateData, ResponseError, void>, 'mutationFn'> = {}) => {
const queryClient = useQueryClient()
return useMutation<ProfileCreateData, ResponseError, void>({
diff --git a/apps/studio/data/profile/profile-identities-query.ts b/apps/studio/data/profile/profile-identities-query.ts
index 52cc46db893..9c70a3ac0fb 100644
--- a/apps/studio/data/profile/profile-identities-query.ts
+++ b/apps/studio/data/profile/profile-identities-query.ts
@@ -1,8 +1,9 @@
import type { UserIdentity } from '@supabase/supabase-js'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { auth } from 'lib/gotrue'
import { profileKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export async function getProfileIdentities() {
// getSession() uses a cached user object, which is almost never stale as the
@@ -28,7 +29,7 @@ type ProfileIdentitiesError = any
export const useProfileIdentitiesQuery = <TData = ProfileIdentitiesData>({
enabled = true,
...options
-}: UseQueryOptions<ProfileIdentitiesData, ProfileIdentitiesError, TData> = {}) => {
+}: UseCustomQueryOptions<ProfileIdentitiesData, ProfileIdentitiesError, TData> = {}) => {
return useQuery<ProfileIdentitiesData, ProfileIdentitiesError, TData>({
queryKey: profileKeys.identities(),
queryFn: () => getProfileIdentities(),
diff --git a/apps/studio/data/profile/profile-query.ts b/apps/studio/data/profile/profile-query.ts
index 86b50d7ffb6..f7553f9b96b 100644
--- a/apps/studio/data/profile/profile-query.ts
+++ b/apps/studio/data/profile/profile-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { profileKeys } from './keys'
import type { Profile } from './types'
@@ -30,7 +30,7 @@ export type ProfileError = ResponseError
export const useProfileQuery = <TData = ProfileData>({
enabled = true,
...options
-}: UseQueryOptions<ProfileData, ProfileError, TData> = {}) => {
+}: UseCustomQueryOptions<ProfileData, ProfileError, TData> = {}) => {
return useQuery<ProfileData, ProfileError, TData>({
queryKey: profileKeys.profile(),
queryFn: ({ signal }) => getProfile(signal),
diff --git a/apps/studio/data/profile/profile-unlink-identity-mutation.ts b/apps/studio/data/profile/profile-unlink-identity-mutation.ts
index eb6eb658c68..4cbd42794fc 100644
--- a/apps/studio/data/profile/profile-unlink-identity-mutation.ts
+++ b/apps/studio/data/profile/profile-unlink-identity-mutation.ts
@@ -1,8 +1,9 @@
import type { UserIdentity } from '@supabase/supabase-js'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { auth } from 'lib/gotrue'
+import { UseCustomMutationOptions } from 'types'
import { profileKeys } from './keys'
const unlinkIdentity = async (identity: UserIdentity) => {
@@ -20,7 +21,7 @@ export const useUnlinkIdentityMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UnlinkIdentityResponse, UnlinkIdentityError, UserIdentity>,
+ UseCustomMutationOptions<UnlinkIdentityResponse, UnlinkIdentityError, UserIdentity>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/profile/profile-update-email-mutation.ts b/apps/studio/data/profile/profile-update-email-mutation.ts
index f2e69821beb..8778d828de3 100644
--- a/apps/studio/data/profile/profile-update-email-mutation.ts
+++ b/apps/studio/data/profile/profile-update-email-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
import { auth } from 'lib/gotrue'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { profileKeys } from './keys'
export type EmailUpdateVariables = {
@@ -27,7 +27,7 @@ export const useEmailUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<EmailUpdateData, ResponseError, EmailUpdateVariables>,
+ UseCustomMutationOptions<EmailUpdateData, ResponseError, EmailUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/profile/profile-update-mutation.ts b/apps/studio/data/profile/profile-update-mutation.ts
index 204cb201425..39fb866292f 100644
--- a/apps/studio/data/profile/profile-update-mutation.ts
+++ b/apps/studio/data/profile/profile-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { profileKeys } from './keys'
export type ProfileUpdateVariables = {
@@ -38,7 +38,7 @@ export const useProfileUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProfileUpdateData, ResponseError, ProfileUpdateVariables>,
+ UseCustomMutationOptions<ProfileUpdateData, ResponseError, ProfileUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/clone-mutation.ts b/apps/studio/data/projects/clone-mutation.ts
index e41daff40de..b68997edb96 100644
--- a/apps/studio/data/projects/clone-mutation.ts
+++ b/apps/studio/data/projects/clone-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectCloneVariables = {
@@ -42,7 +42,7 @@ export const useProjectCloneMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectCloneData, ResponseError, ProjectCloneVariables>,
+ UseCustomMutationOptions<ProjectCloneData, ResponseError, ProjectCloneVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/clone-query.ts b/apps/studio/data/projects/clone-query.ts
index 7de7d173b1d..fac667aad75 100644
--- a/apps/studio/data/projects/clone-query.ts
+++ b/apps/studio/data/projects/clone-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { InfraInstanceSize } from 'components/interfaces/DiskManagement/DiskManagement.types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export async function getCloneBackups(projectRef?: string) {
@@ -25,7 +25,7 @@ export const useCloneBackupsQuery = <
},
>(
{ projectRef }: { projectRef?: string },
- options: UseQueryOptions<CloneBackupsData, CloneBackupsError, TData> = {}
+ options: UseCustomQueryOptions<CloneBackupsData, CloneBackupsError, TData> = {}
) => {
return useQuery<CloneBackupsData, CloneBackupsError, TData>({
queryKey: projectKeys.listCloneBackups(projectRef),
diff --git a/apps/studio/data/projects/clone-status-query.ts b/apps/studio/data/projects/clone-status-query.ts
index 2ed76392964..440083da2cb 100644
--- a/apps/studio/data/projects/clone-status-query.ts
+++ b/apps/studio/data/projects/clone-status-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export type CloneStatus = components['schemas']['ProjectClonedStatusResponse']
@@ -22,7 +22,7 @@ export type CloneStatusError = ResponseError
export const useCloneStatusQuery = <TData = CloneStatusData>(
{ projectRef }: { projectRef?: string },
- options: UseQueryOptions<CloneStatusData, CloneStatusError, TData> = {}
+ options: UseCustomQueryOptions<CloneStatusData, CloneStatusError, TData> = {}
) => {
return useQuery<CloneStatusData, CloneStatusError, TData>({
queryKey: projectKeys.listCloneStatus(projectRef),
diff --git a/apps/studio/data/projects/org-projects-infinite-query.ts b/apps/studio/data/projects/org-projects-infinite-query.ts
index 47524700e9c..350c67adbd6 100644
--- a/apps/studio/data/projects/org-projects-infinite-query.ts
+++ b/apps/studio/data/projects/org-projects-infinite-query.ts
@@ -1,9 +1,9 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions, useQueryClient } from '@tanstack/react-query'
+import { useInfiniteQuery, useQueryClient } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useProfile } from 'lib/profile'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { INFINITE_PROJECTS_KEY_PREFIX, projectKeys } from './keys'
// [Joshen] Try to keep this value a multiple of 6 (common denominator of 2 and 3) to fit the cards view
@@ -65,7 +65,7 @@ export const useOrgProjectsInfiniteQuery = <TData = OrgProjectsInfiniteData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<OrgProjectsInfiniteData, OrgProjectsInfiniteError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<OrgProjectsInfiniteData, OrgProjectsInfiniteError, TData> = {}
) => {
const { profile } = useProfile()
return useInfiniteQuery<OrgProjectsInfiniteData, OrgProjectsInfiniteError, TData>({
diff --git a/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts b/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts
index b3cb3cca45e..8c29d8c8cb7 100644
--- a/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts
+++ b/apps/studio/data/projects/project-by-fly-extension-id-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ProjectByFlyExtensionIdVariables = {
flyExtensionId: string
@@ -28,7 +28,11 @@ export const useProjectByFlyExtensionIdMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectByFlyExtensionIdData, ResponseError, ProjectByFlyExtensionIdVariables>,
+ UseCustomMutationOptions<
+ ProjectByFlyExtensionIdData,
+ ResponseError,
+ ProjectByFlyExtensionIdVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<ProjectByFlyExtensionIdData, ResponseError, ProjectByFlyExtensionIdVariables>({
diff --git a/apps/studio/data/projects/project-create-mutation.ts b/apps/studio/data/projects/project-create-mutation.ts
index d1206196641..77fa75b68f0 100644
--- a/apps/studio/data/projects/project-create-mutation.ts
+++ b/apps/studio/data/projects/project-create-mutation.ts
@@ -1,11 +1,11 @@
import * as Sentry from '@sentry/nextjs'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
import { PROVIDERS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { projectKeys } from './keys'
import { DesiredInstanceSize, PostgresEngine, ReleaseChannel } from './new-project.constants'
@@ -90,7 +90,7 @@ export const useProjectCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectCreateData, ResponseError, ProjectCreateVariables>,
+ UseCustomMutationOptions<ProjectCreateData, ResponseError, ProjectCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/project-delete-mutation.ts b/apps/studio/data/projects/project-delete-mutation.ts
index 5e6bd9fba60..b3a2af446eb 100644
--- a/apps/studio/data/projects/project-delete-mutation.ts
+++ b/apps/studio/data/projects/project-delete-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
import { organizationKeys } from 'data/organizations/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectDeleteVariables = {
@@ -27,7 +27,7 @@ export const useProjectDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectDeleteData, ResponseError, ProjectDeleteVariables>,
+ UseCustomMutationOptions<ProjectDeleteData, ResponseError, ProjectDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/project-detail-query.ts b/apps/studio/data/projects/project-detail-query.ts
index df530655ef0..7ba84d421cb 100644
--- a/apps/studio/data/projects/project-detail-query.ts
+++ b/apps/studio/data/projects/project-detail-query.ts
@@ -1,8 +1,8 @@
-import { QueryClient, useQuery, useQueryClient, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery, useQueryClient } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError, isValidConnString } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
import { OrgProjectsResponse } from './org-projects-infinite-query'
@@ -42,7 +42,10 @@ export type ProjectDetailError = ResponseError
export const useProjectDetailQuery = <TData = ProjectDetailData>(
{ ref }: ProjectDetailVariables,
- { enabled = true, ...options }: UseQueryOptions<ProjectDetailData, ProjectDetailError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ProjectDetailData, ProjectDetailError, TData> = {}
) =>
useQuery<ProjectDetailData, ProjectDetailError, TData>({
queryKey: projectKeys.detail(ref),
diff --git a/apps/studio/data/projects/project-pause-mutation.ts b/apps/studio/data/projects/project-pause-mutation.ts
index df177591361..8f17f261c00 100644
--- a/apps/studio/data/projects/project-pause-mutation.ts
+++ b/apps/studio/data/projects/project-pause-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ProjectPauseVariables = {
ref: string
@@ -23,7 +23,7 @@ export const useProjectPauseMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectPauseData, ResponseError, ProjectPauseVariables>,
+ UseCustomMutationOptions<ProjectPauseData, ResponseError, ProjectPauseVariables>,
'mutationFn'
> = {}) => {
return useMutation<ProjectPauseData, ResponseError, ProjectPauseVariables>({
diff --git a/apps/studio/data/projects/project-pause-status-query.ts b/apps/studio/data/projects/project-pause-status-query.ts
index 64ed5103101..5297ffd73b1 100644
--- a/apps/studio/data/projects/project-pause-status-query.ts
+++ b/apps/studio/data/projects/project-pause-status-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectPauseStatusVariables = { ref?: string }
@@ -29,7 +29,7 @@ export const useProjectPauseStatusQuery = <TData = ProjectPauseStatusData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectPauseStatusData, ProjectPauseStatusError, TData> = {}
+ }: UseCustomQueryOptions<ProjectPauseStatusData, ProjectPauseStatusError, TData> = {}
) =>
useQuery<ProjectPauseStatusData, ProjectPauseStatusError, TData>({
queryKey: projectKeys.pauseStatus(ref),
diff --git a/apps/studio/data/projects/project-restart-mutation.ts b/apps/studio/data/projects/project-restart-mutation.ts
index 064d8a6b50b..029d70a7fa1 100644
--- a/apps/studio/data/projects/project-restart-mutation.ts
+++ b/apps/studio/data/projects/project-restart-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ProjectRestartVariables = {
ref: string
@@ -31,7 +31,7 @@ export const useProjectRestartMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectRestartData, ResponseError, ProjectRestartVariables>,
+ UseCustomMutationOptions<ProjectRestartData, ResponseError, ProjectRestartVariables>,
'mutationFn'
> = {}) => {
return useMutation<ProjectRestartData, ResponseError, ProjectRestartVariables>({
diff --git a/apps/studio/data/projects/project-restart-services-mutation.ts b/apps/studio/data/projects/project-restart-services-mutation.ts
index f5703f6b2d3..5fe3675a38c 100644
--- a/apps/studio/data/projects/project-restart-services-mutation.ts
+++ b/apps/studio/data/projects/project-restart-services-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ProjectRestartServicesVariables = {
ref: string
@@ -52,7 +52,11 @@ export const useProjectRestartServicesMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectRestartServicesData, ResponseError, ProjectRestartServicesVariables>,
+ UseCustomMutationOptions<
+ ProjectRestartServicesData,
+ ResponseError,
+ ProjectRestartServicesVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<ProjectRestartServicesData, ResponseError, ProjectRestartServicesVariables>({
diff --git a/apps/studio/data/projects/project-restore-mutation.ts b/apps/studio/data/projects/project-restore-mutation.ts
index 7037970e2bc..01b276a5997 100644
--- a/apps/studio/data/projects/project-restore-mutation.ts
+++ b/apps/studio/data/projects/project-restore-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { PostgresEngine, ReleaseChannel } from './new-project.constants'
export type ProjectRestoreVariables = {
@@ -34,7 +34,7 @@ export const useProjectRestoreMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectRestoreData, ResponseError, ProjectRestoreVariables>,
+ UseCustomMutationOptions<ProjectRestoreData, ResponseError, ProjectRestoreVariables>,
'mutationFn'
> = {}) => {
return useMutation<ProjectRestoreData, ResponseError, ProjectRestoreVariables>({
diff --git a/apps/studio/data/projects/project-service-versions.ts b/apps/studio/data/projects/project-service-versions.ts
index dabd53811db..6411cf2f29f 100644
--- a/apps/studio/data/projects/project-service-versions.ts
+++ b/apps/studio/data/projects/project-service-versions.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectServiceVersionsVariables = {
@@ -30,7 +30,7 @@ export const useProjectServiceVersionsQuery = <TData = ProjectServiceVersionsDat
{
enabled = true,
...options
- }: UseQueryOptions<ProjectServiceVersionsData, ProjectServiceVersionsError, TData> = {}
+ }: UseCustomQueryOptions<ProjectServiceVersionsData, ProjectServiceVersionsError, TData> = {}
) =>
useQuery<ProjectServiceVersionsData, ProjectServiceVersionsError, TData>({
queryKey: projectKeys.serviceVersions(projectRef),
diff --git a/apps/studio/data/projects/project-status-query.ts b/apps/studio/data/projects/project-status-query.ts
index 1503aeb5bd1..07beb16804d 100644
--- a/apps/studio/data/projects/project-status-query.ts
+++ b/apps/studio/data/projects/project-status-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectStatusVariables = {
@@ -28,7 +28,10 @@ export type ProjectStatusError = ResponseError
export const useProjectStatusQuery = <TData = ProjectStatusData>(
{ projectRef }: ProjectStatusVariables,
- { enabled = true, ...options }: UseQueryOptions<ProjectStatusData, ProjectStatusError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ProjectStatusData, ProjectStatusError, TData> = {}
) =>
useQuery<ProjectStatusData, ProjectStatusError, TData>({
queryKey: projectKeys.status(projectRef),
diff --git a/apps/studio/data/projects/project-transfer-mutation.ts b/apps/studio/data/projects/project-transfer-mutation.ts
index 7aee266c13c..6ad56c73fac 100644
--- a/apps/studio/data/projects/project-transfer-mutation.ts
+++ b/apps/studio/data/projects/project-transfer-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectTransferVariables = {
@@ -36,7 +36,7 @@ export const useProjectTransferMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectTransferData, ResponseError, ProjectTransferVariables>,
+ UseCustomMutationOptions<ProjectTransferData, ResponseError, ProjectTransferVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/project-transfer-preview-query.ts b/apps/studio/data/projects/project-transfer-preview-query.ts
index 75cc11428e7..3f7d7be8bb7 100644
--- a/apps/studio/data/projects/project-transfer-preview-query.ts
+++ b/apps/studio/data/projects/project-transfer-preview-query.ts
@@ -1,7 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
import { projectKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type ProjectTransferPreviewVariables = {
projectRef?: string
@@ -35,7 +36,7 @@ export const useProjectTransferPreviewQuery = <TData = ProjectTransferPreviewDat
{
enabled = true,
...options
- }: UseQueryOptions<ProjectTransferPreviewData, ProjectTransferPreviewError, TData> = {}
+ }: UseCustomQueryOptions<ProjectTransferPreviewData, ProjectTransferPreviewError, TData> = {}
) =>
useQuery<ProjectTransferPreviewData, ProjectTransferPreviewError, TData>({
queryKey: projectKeys.projectTransferPreview(projectRef, targetOrganizationSlug),
diff --git a/apps/studio/data/projects/project-type-generation-query.ts b/apps/studio/data/projects/project-type-generation-query.ts
index 02fe84604e6..b1a43d0063d 100644
--- a/apps/studio/data/projects/project-type-generation-query.ts
+++ b/apps/studio/data/projects/project-type-generation-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
export type GenerateTypesVariables = { ref?: string; included_schemas?: string }
@@ -26,7 +26,10 @@ export type GenerateTypesError = ResponseError
export const useGenerateTypesQuery = <TData = GenerateTypesData>(
{ ref, included_schemas }: GenerateTypesVariables,
- { enabled = true, ...options }: UseQueryOptions<GenerateTypesData, GenerateTypesError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<GenerateTypesData, GenerateTypesError, TData> = {}
) =>
useQuery<GenerateTypesData, GenerateTypesError, TData>({
queryKey: projectKeys.types(ref),
diff --git a/apps/studio/data/projects/project-update-mutation.ts b/apps/studio/data/projects/project-update-mutation.ts
index 3953d5f5af8..c9fd55d25b5 100644
--- a/apps/studio/data/projects/project-update-mutation.ts
+++ b/apps/studio/data/projects/project-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { projectKeys } from './keys'
export type ProjectUpdateVariables = {
@@ -32,7 +32,7 @@ export const useProjectUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectUpdateData, ResponseError, ProjectUpdateVariables>,
+ UseCustomMutationOptions<ProjectUpdateData, ResponseError, ProjectUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/projects/project-upgrade-mutation.ts b/apps/studio/data/projects/project-upgrade-mutation.ts
index fb775e73c77..0efdafe47fb 100644
--- a/apps/studio/data/projects/project-upgrade-mutation.ts
+++ b/apps/studio/data/projects/project-upgrade-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type ProjectUpgradeVariables = components['schemas']['UpgradeDatabaseBody'] & {
ref: string
@@ -29,7 +29,7 @@ export const useProjectUpgradeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectUpgradeData, ResponseError, ProjectUpgradeVariables>,
+ UseCustomMutationOptions<ProjectUpgradeData, ResponseError, ProjectUpgradeVariables>,
'mutationFn'
> = {}) => {
return useMutation<ProjectUpgradeData, ResponseError, ProjectUpgradeVariables>({
diff --git a/apps/studio/data/projects/projects-infinite-query.ts b/apps/studio/data/projects/projects-infinite-query.ts
index d25dba27ce7..ed2259a8c35 100644
--- a/apps/studio/data/projects/projects-infinite-query.ts
+++ b/apps/studio/data/projects/projects-infinite-query.ts
@@ -1,9 +1,9 @@
-import { useInfiniteQuery, UseInfiniteQueryOptions } from '@tanstack/react-query'
+import { useInfiniteQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useProfile } from 'lib/profile'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomInfiniteQueryOptions } from 'types'
import { projectKeys } from './keys'
const DEFAULT_LIMIT = 100
@@ -50,7 +50,7 @@ export const useProjectsInfiniteQuery = <TData = ProjectsInfiniteData>(
{
enabled = true,
...options
- }: UseInfiniteQueryOptions<ProjectsInfiniteData, ProjectsInfiniteError, TData> = {}
+ }: UseCustomInfiniteQueryOptions<ProjectsInfiniteData, ProjectsInfiniteError, TData> = {}
) => {
const { profile } = useProfile()
return useInfiniteQuery<ProjectsInfiniteData, ProjectsInfiniteError, TData>({
diff --git a/apps/studio/data/projects/projects-query.ts b/apps/studio/data/projects/projects-query.ts
index 458d12374b0..b478e70b3b1 100644
--- a/apps/studio/data/projects/projects-query.ts
+++ b/apps/studio/data/projects/projects-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { useProfile } from 'lib/profile'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { projectKeys } from './keys'
type PaginatedProjectsResponse = components['schemas']['ListProjectsPaginatedResponse']
@@ -32,7 +32,7 @@ export type ProjectsError = ResponseError
export const useProjectsQuery = <TData = ProjectsData>({
enabled = true,
...options
-}: UseQueryOptions<ProjectsData, ProjectsError, TData> = {}) => {
+}: UseCustomQueryOptions<ProjectsData, ProjectsError, TData> = {}) => {
const { profile } = useProfile()
return useQuery<ProjectsData, ProjectsError, TData>({
queryKey: projectKeys.list(),
diff --git a/apps/studio/data/read-replicas/load-balancers-query.ts b/apps/studio/data/read-replicas/load-balancers-query.ts
index 1401742cba5..321575a8bd4 100644
--- a/apps/studio/data/read-replicas/load-balancers-query.ts
+++ b/apps/studio/data/read-replicas/load-balancers-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicaKeys } from './keys'
export type LoadBalancersVariables = {
@@ -32,7 +32,10 @@ export type LoadBalancersError = ResponseError
export const useLoadBalancersQuery = <TData = LoadBalancersData>(
{ projectRef }: LoadBalancersVariables,
- { enabled = true, ...options }: UseQueryOptions<LoadBalancersData, LoadBalancersError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<LoadBalancersData, LoadBalancersError, TData> = {}
) => {
return useQuery<LoadBalancersData, LoadBalancersError, TData>({
queryKey: replicaKeys.loadBalancers(projectRef),
diff --git a/apps/studio/data/read-replicas/replica-lag-query.ts b/apps/studio/data/read-replicas/replica-lag-query.ts
index 2c224f0ec87..dc026bbfb35 100644
--- a/apps/studio/data/read-replicas/replica-lag-query.ts
+++ b/apps/studio/data/read-replicas/replica-lag-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { replicaKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export const replicationLagSql = () => {
const sql = /* SQL */ `
@@ -43,7 +44,7 @@ export const useReplicationLagQuery = <TData = ReplicationLagData>(
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationLagData, ReplicationLagError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationLagData, ReplicationLagError, TData> = {}
) =>
useQuery<ReplicationLagData, ReplicationLagError, TData>({
queryKey: replicaKeys.replicaLag(projectRef, id),
diff --git a/apps/studio/data/read-replicas/replica-remove-mutation.ts b/apps/studio/data/read-replicas/replica-remove-mutation.ts
index aa175e3cc4c..ac563da61b5 100644
--- a/apps/studio/data/read-replicas/replica-remove-mutation.ts
+++ b/apps/studio/data/read-replicas/replica-remove-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicaKeys } from './keys'
export type ReadReplicaRemoveVariables = {
@@ -31,7 +31,7 @@ export const useReadReplicaRemoveMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ReadReplicaRemoveData, ResponseError, ReadReplicaRemoveVariables>,
+ UseCustomMutationOptions<ReadReplicaRemoveData, ResponseError, ReadReplicaRemoveVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/read-replicas/replica-setup-mutation.ts b/apps/studio/data/read-replicas/replica-setup-mutation.ts
index e7d812f36f3..eac1d970fae 100644
--- a/apps/studio/data/read-replicas/replica-setup-mutation.ts
+++ b/apps/studio/data/read-replicas/replica-setup-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicaKeys } from './keys'
export type Region =
@@ -47,7 +47,7 @@ export const useReadReplicaSetUpMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ReadReplicaSetUpData, ResponseError, ReadReplicaSetUpVariables>,
+ UseCustomMutationOptions<ReadReplicaSetUpData, ResponseError, ReadReplicaSetUpVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/read-replicas/replicas-query.ts b/apps/studio/data/read-replicas/replicas-query.ts
index 80d64517f51..ea8e86b6377 100644
--- a/apps/studio/data/read-replicas/replicas-query.ts
+++ b/apps/studio/data/read-replicas/replicas-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicaKeys } from './keys'
export const MAX_REPLICAS_BELOW_XL = 2
@@ -31,7 +31,10 @@ export type ReadReplicasError = ResponseError
export const useReadReplicasQuery = <TData = ReadReplicasData>(
{ projectRef }: ReadReplicasVariables,
- { enabled = true, ...options }: UseQueryOptions<ReadReplicasData, ReadReplicasError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ReadReplicasData, ReadReplicasError, TData> = {}
) => {
return useQuery<ReadReplicasData, ReadReplicasError, TData>({
queryKey: replicaKeys.list(projectRef),
diff --git a/apps/studio/data/read-replicas/replicas-status-query.ts b/apps/studio/data/read-replicas/replicas-status-query.ts
index f601b15d0e2..796d485c240 100644
--- a/apps/studio/data/read-replicas/replicas-status-query.ts
+++ b/apps/studio/data/read-replicas/replicas-status-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicaKeys } from './keys'
// [Joshen] Is it possible to import this from the code gen?
@@ -46,7 +46,7 @@ export const useReadReplicasStatusesQuery = <TData = ReadReplicasStatusesData>(
{
enabled = true,
...options
- }: UseQueryOptions<ReadReplicasStatusesData, ReadReplicasStatusesError, TData> = {}
+ }: UseCustomQueryOptions<ReadReplicasStatusesData, ReadReplicasStatusesError, TData> = {}
) => {
return useQuery<ReadReplicasStatusesData, ReadReplicasStatusesError, TData>({
queryKey: replicaKeys.statuses(projectRef),
diff --git a/apps/studio/data/realtime/realtime-config-mutation.ts b/apps/studio/data/realtime/realtime-config-mutation.ts
index 62e29911ee5..3aa6e0ef9e8 100644
--- a/apps/studio/data/realtime/realtime-config-mutation.ts
+++ b/apps/studio/data/realtime/realtime-config-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { realtimeKeys } from './keys'
export type RealtimeConfigurationUpdateVariables = {
@@ -52,7 +52,7 @@ export const useRealtimeConfigurationUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
RealtimeConfigurationUpdateData,
ResponseError,
RealtimeConfigurationUpdateVariables
diff --git a/apps/studio/data/realtime/realtime-config-query.ts b/apps/studio/data/realtime/realtime-config-query.ts
index d5cff6a73f8..4867fadd241 100644
--- a/apps/studio/data/realtime/realtime-config-query.ts
+++ b/apps/studio/data/realtime/realtime-config-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { realtimeKeys } from './keys'
export type RealtimeConfigurationVariables = {
@@ -50,7 +50,7 @@ export const useRealtimeConfigurationQuery = <TData = RealtimeConfigurationData>
{
enabled = true,
...options
- }: UseQueryOptions<RealtimeConfigurationData, RealtimeConfigurationError, TData> = {}
+ }: UseCustomQueryOptions<RealtimeConfigurationData, RealtimeConfigurationError, TData> = {}
) =>
useQuery<RealtimeConfigurationData, RealtimeConfigurationError, TData>({
queryKey: realtimeKeys.configuration(projectRef),
diff --git a/apps/studio/data/replication/create-destination-pipeline-mutation.ts b/apps/studio/data/replication/create-destination-pipeline-mutation.ts
index 92fa12e1275..a313280119d 100644
--- a/apps/studio/data/replication/create-destination-pipeline-mutation.ts
+++ b/apps/studio/data/replication/create-destination-pipeline-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type BigQueryDestinationConfig = {
@@ -121,7 +121,11 @@ export const useCreateDestinationPipelineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CreateDestinationPipelineData, ResponseError, CreateDestinationPipelineParams>,
+ UseCustomMutationOptions<
+ CreateDestinationPipelineData,
+ ResponseError,
+ CreateDestinationPipelineParams
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/create-publication-mutation.ts b/apps/studio/data/replication/create-publication-mutation.ts
index 949592f796d..c8530d853f5 100644
--- a/apps/studio/data/replication/create-publication-mutation.ts
+++ b/apps/studio/data/replication/create-publication-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type CreatePublicationParams = {
@@ -40,7 +40,7 @@ export const useCreatePublicationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CreatePublicationData, ResponseError, CreatePublicationParams>,
+ UseCustomMutationOptions<CreatePublicationData, ResponseError, CreatePublicationParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/create-tenant-source-mutation.ts b/apps/studio/data/replication/create-tenant-source-mutation.ts
index 16251727e34..49ee0e1a209 100644
--- a/apps/studio/data/replication/create-tenant-source-mutation.ts
+++ b/apps/studio/data/replication/create-tenant-source-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type CreateTenantSourceParams = {
@@ -30,7 +30,7 @@ export const useCreateTenantSourceMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<CreateTenantSourceData, ResponseError, CreateTenantSourceParams>,
+ UseCustomMutationOptions<CreateTenantSourceData, ResponseError, CreateTenantSourceParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/delete-destination-pipeline-mutation.ts b/apps/studio/data/replication/delete-destination-pipeline-mutation.ts
index c6a6091c04b..5df1384074a 100644
--- a/apps/studio/data/replication/delete-destination-pipeline-mutation.ts
+++ b/apps/studio/data/replication/delete-destination-pipeline-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type DeleteDestinationPipelineParams = {
@@ -38,7 +38,11 @@ export const useDeleteDestinationPipelineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DeleteDestinationPipelineData, ResponseError, DeleteDestinationPipelineParams>,
+ UseCustomMutationOptions<
+ DeleteDestinationPipelineData,
+ ResponseError,
+ DeleteDestinationPipelineParams
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/destination-by-id-query.ts b/apps/studio/data/replication/destination-by-id-query.ts
index c157f0108e2..80873804aaf 100644
--- a/apps/studio/data/replication/destination-by-id-query.ts
+++ b/apps/studio/data/replication/destination-by-id-query.ts
@@ -1,8 +1,8 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationDestinationByIdParams = { projectRef?: string; destinationId?: number }
@@ -31,7 +31,7 @@ export const useReplicationDestinationByIdQuery = <TData = ReplicationDestinatio
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationDestinationByIdData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationDestinationByIdData, ResponseError, TData> = {}
) =>
useQuery<ReplicationDestinationByIdData, ResponseError, TData>({
queryKey: replicationKeys.destinationById(projectRef, destinationId),
diff --git a/apps/studio/data/replication/destinations-query.ts b/apps/studio/data/replication/destinations-query.ts
index 63fd8098fae..9c73561f751 100644
--- a/apps/studio/data/replication/destinations-query.ts
+++ b/apps/studio/data/replication/destinations-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationDestinationsParams = { projectRef?: string }
@@ -30,7 +30,7 @@ export const useReplicationDestinationsQuery = <TData = ReplicationDestinationsD
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationDestinationsData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationDestinationsData, ResponseError, TData> = {}
) =>
useQuery<ReplicationDestinationsData, ResponseError, TData>({
queryKey: replicationKeys.destinations(projectRef),
diff --git a/apps/studio/data/replication/pipeline-by-id-query.ts b/apps/studio/data/replication/pipeline-by-id-query.ts
index 65e3584b3a6..ca8c0cfcaea 100644
--- a/apps/studio/data/replication/pipeline-by-id-query.ts
+++ b/apps/studio/data/replication/pipeline-by-id-query.ts
@@ -1,8 +1,8 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPipelineByIdParams = { projectRef?: string; pipelineId?: number }
@@ -31,7 +31,7 @@ export const useReplicationPipelineByIdQuery = <TData = ReplicationPipelineByIdD
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationPipelineByIdData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPipelineByIdData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPipelineByIdData, ResponseError, TData>({
queryKey: replicationKeys.pipelineById(projectRef, pipelineId),
diff --git a/apps/studio/data/replication/pipeline-replication-status-query.ts b/apps/studio/data/replication/pipeline-replication-status-query.ts
index 9289ff21ea6..f4e164fc38f 100644
--- a/apps/studio/data/replication/pipeline-replication-status-query.ts
+++ b/apps/studio/data/replication/pipeline-replication-status-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPipelineReplicationStatusParams = { projectRef?: string; pipelineId?: number }
@@ -38,7 +38,7 @@ export const useReplicationPipelineReplicationStatusQuery = <
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationPipelineReplicationStatusData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPipelineReplicationStatusData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPipelineReplicationStatusData, ResponseError, TData>({
queryKey: replicationKeys.pipelinesReplicationStatus(projectRef, pipelineId),
diff --git a/apps/studio/data/replication/pipeline-status-query.ts b/apps/studio/data/replication/pipeline-status-query.ts
index 400884d4628..1e6b2d9787d 100644
--- a/apps/studio/data/replication/pipeline-status-query.ts
+++ b/apps/studio/data/replication/pipeline-status-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPipelinesStatusParams = { projectRef?: string; pipelineId?: number }
@@ -33,7 +33,7 @@ export const useReplicationPipelineStatusQuery = <TData = ReplicationPipelineSta
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationPipelineStatusData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPipelineStatusData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPipelineStatusData, ResponseError, TData>({
queryKey: replicationKeys.pipelinesStatus(projectRef, pipelineId),
diff --git a/apps/studio/data/replication/pipeline-version-query.ts b/apps/studio/data/replication/pipeline-version-query.ts
index 911ced6ff53..024e2874040 100644
--- a/apps/studio/data/replication/pipeline-version-query.ts
+++ b/apps/studio/data/replication/pipeline-version-query.ts
@@ -1,8 +1,8 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPipelineVersionParams = { projectRef?: string; pipelineId?: number }
@@ -35,7 +35,7 @@ export const useReplicationPipelineVersionQuery = <TData = ReplicationPipelineVe
refetchOnMount = false,
refetchOnWindowFocus = false,
...options
- }: UseQueryOptions<ReplicationPipelineVersionData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPipelineVersionData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPipelineVersionData, ResponseError, TData>({
queryKey: replicationKeys.pipelinesVersion(projectRef, pipelineId),
diff --git a/apps/studio/data/replication/pipelines-query.ts b/apps/studio/data/replication/pipelines-query.ts
index cb00595c6f2..5e9ed35d57a 100644
--- a/apps/studio/data/replication/pipelines-query.ts
+++ b/apps/studio/data/replication/pipelines-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPipelinesParams = { projectRef?: string }
@@ -31,7 +31,7 @@ export const useReplicationPipelinesQuery = <TData = ReplicationPipelinesData>(
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationPipelinesData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPipelinesData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPipelinesData, ResponseError, TData>({
queryKey: replicationKeys.pipelines(projectRef),
diff --git a/apps/studio/data/replication/publication-delete-mutation.ts b/apps/studio/data/replication/publication-delete-mutation.ts
index f1fca52927a..984f6c4dccf 100644
--- a/apps/studio/data/replication/publication-delete-mutation.ts
+++ b/apps/studio/data/replication/publication-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type DeletePublicationParams = {
@@ -41,7 +41,7 @@ export const useDeletePublicationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<DeletePublicationData, ResponseError, DeletePublicationParams>,
+ UseCustomMutationOptions<DeletePublicationData, ResponseError, DeletePublicationParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/publications-query.ts b/apps/studio/data/replication/publications-query.ts
index 6fb56ad7982..baa75854e4e 100644
--- a/apps/studio/data/replication/publications-query.ts
+++ b/apps/studio/data/replication/publications-query.ts
@@ -1,8 +1,8 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationPublicationsParams = { projectRef?: string; sourceId?: number }
@@ -39,7 +39,7 @@ export const useReplicationPublicationsQuery = <TData = ReplicationPublicationsD
{
enabled = true,
...options
- }: UseQueryOptions<ReplicationPublicationsData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ReplicationPublicationsData, ResponseError, TData> = {}
) =>
useQuery<ReplicationPublicationsData, ResponseError, TData>({
queryKey: replicationKeys.publications(projectRef, sourceId),
diff --git a/apps/studio/data/replication/rollback-table-mutation.ts b/apps/studio/data/replication/rollback-table-mutation.ts
index cc4e2d1a8e9..d95b62b2e08 100644
--- a/apps/studio/data/replication/rollback-table-mutation.ts
+++ b/apps/studio/data/replication/rollback-table-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type RollbackType = 'individual' | 'full'
@@ -52,7 +52,7 @@ export const useRollbackTableMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<RollbackTableData, ResponseError, RollbackTableParams>,
+ UseCustomMutationOptions<RollbackTableData, ResponseError, RollbackTableParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/sources-query.ts b/apps/studio/data/replication/sources-query.ts
index 14201ee64ce..8561af72a1d 100644
--- a/apps/studio/data/replication/sources-query.ts
+++ b/apps/studio/data/replication/sources-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationSourcesParams = { projectRef?: string }
@@ -27,7 +27,10 @@ export type ReplicationSourcesData = Awaited<ReturnType<typeof fetchReplicationS
export const useReplicationSourcesQuery = <TData = ReplicationSourcesData>(
{ projectRef }: ReplicationSourcesParams,
- { enabled = true, ...options }: UseQueryOptions<ReplicationSourcesData, ResponseError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ReplicationSourcesData, ResponseError, TData> = {}
) =>
useQuery<ReplicationSourcesData, ResponseError, TData>({
queryKey: replicationKeys.sources(projectRef),
diff --git a/apps/studio/data/replication/start-pipeline-mutation.ts b/apps/studio/data/replication/start-pipeline-mutation.ts
index a5cc611f86b..f613a0c44d3 100644
--- a/apps/studio/data/replication/start-pipeline-mutation.ts
+++ b/apps/studio/data/replication/start-pipeline-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type StartPipelineParams = {
@@ -34,7 +34,7 @@ export const useStartPipelineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<StartPipelineData, ResponseError, StartPipelineParams>,
+ UseCustomMutationOptions<StartPipelineData, ResponseError, StartPipelineParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/stop-pipeline-mutation.ts b/apps/studio/data/replication/stop-pipeline-mutation.ts
index ff59291ceca..33a9e10af0c 100644
--- a/apps/studio/data/replication/stop-pipeline-mutation.ts
+++ b/apps/studio/data/replication/stop-pipeline-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type StopPipelineParams = {
@@ -31,7 +31,7 @@ export const useStopPipelineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<StartPipelineData, ResponseError, StopPipelineParams>,
+ UseCustomMutationOptions<StartPipelineData, ResponseError, StopPipelineParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/tables-query.ts b/apps/studio/data/replication/tables-query.ts
index a557f33d6f3..0635055aba3 100644
--- a/apps/studio/data/replication/tables-query.ts
+++ b/apps/studio/data/replication/tables-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { replicationKeys } from './keys'
type ReplicationTablesParams = { projectRef?: string; sourceId?: number }
@@ -28,7 +28,10 @@ export type ReplicationTablesData = Awaited<ReturnType<typeof fetchReplicationTa
export const useReplicationTablesQuery = <TData = ReplicationTablesData>(
{ projectRef, sourceId }: ReplicationTablesParams,
- { enabled = true, ...options }: UseQueryOptions<ReplicationTablesData, ResponseError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ReplicationTablesData, ResponseError, TData> = {}
) =>
useQuery<ReplicationTablesData, ResponseError, TData>({
queryKey: replicationKeys.tables(projectRef, sourceId),
diff --git a/apps/studio/data/replication/update-destination-pipeline-mutation.ts b/apps/studio/data/replication/update-destination-pipeline-mutation.ts
index 49412f264d8..ae7def269b4 100644
--- a/apps/studio/data/replication/update-destination-pipeline-mutation.ts
+++ b/apps/studio/data/replication/update-destination-pipeline-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
export type BigQueryDestinationConfig = {
@@ -125,7 +125,11 @@ export const useUpdateDestinationPipelineMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdateDestinationPipelineData, ResponseError, UpdateDestinationPipelineParams>,
+ UseCustomMutationOptions<
+ UpdateDestinationPipelineData,
+ ResponseError,
+ UpdateDestinationPipelineParams
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/replication/update-pipeline-version-mutation.ts b/apps/studio/data/replication/update-pipeline-version-mutation.ts
index 1014f85d6ca..ed679ddb976 100644
--- a/apps/studio/data/replication/update-pipeline-version-mutation.ts
+++ b/apps/studio/data/replication/update-pipeline-version-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { replicationKeys } from './keys'
type UpdatePipelineVersionParams = {
@@ -39,7 +39,7 @@ export const useUpdatePipelineVersionMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<UpdatePipelineVersionData, ResponseError, UpdatePipelineVersionParams>,
+ UseCustomMutationOptions<UpdatePipelineVersionData, ResponseError, UpdatePipelineVersionParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/secrets/secrets-create-mutation.ts b/apps/studio/data/secrets/secrets-create-mutation.ts
index 9463a8b3874..7518c2338eb 100644
--- a/apps/studio/data/secrets/secrets-create-mutation.ts
+++ b/apps/studio/data/secrets/secrets-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { secretsKeys } from './keys'
export type SecretsCreateVariables = {
@@ -29,7 +29,7 @@ export const useSecretsCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SecretsCreateData, ResponseError, SecretsCreateVariables>,
+ UseCustomMutationOptions<SecretsCreateData, ResponseError, SecretsCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/secrets/secrets-delete-mutation.ts b/apps/studio/data/secrets/secrets-delete-mutation.ts
index fc0df36948b..834410e9826 100644
--- a/apps/studio/data/secrets/secrets-delete-mutation.ts
+++ b/apps/studio/data/secrets/secrets-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { secretsKeys } from './keys'
export type SecretsDeleteVariables = {
@@ -29,7 +29,7 @@ export const useSecretsDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SecretsDeleteData, ResponseError, SecretsDeleteVariables>,
+ UseCustomMutationOptions<SecretsDeleteData, ResponseError, SecretsDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/secrets/secrets-query.ts b/apps/studio/data/secrets/secrets-query.ts
index ae41c2455b3..512aafb1fe3 100644
--- a/apps/studio/data/secrets/secrets-query.ts
+++ b/apps/studio/data/secrets/secrets-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { secretsKeys } from './keys'
export type SecretsVariables = {
@@ -28,7 +28,7 @@ export type SecretsError = ResponseError
export const useSecretsQuery = <TData = SecretsData>(
{ projectRef }: SecretsVariables,
- { enabled = true, ...options }: UseQueryOptions<SecretsData, SecretsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<SecretsData, SecretsError, TData> = {}
) =>
useQuery<SecretsData, SecretsError, TData>({
queryKey: secretsKeys.list(projectRef),
diff --git a/apps/studio/data/service-status/edge-functions-status-query.ts b/apps/studio/data/service-status/edge-functions-status-query.ts
index f21c992cb93..9ec5dce7ad4 100644
--- a/apps/studio/data/service-status/edge-functions-status-query.ts
+++ b/apps/studio/data/service-status/edge-functions-status-query.ts
@@ -1,6 +1,6 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { serviceStatusKeys } from './keys'
export type EdgeFunctionServiceStatusVariables = {
@@ -28,7 +28,11 @@ export const useEdgeFunctionServiceStatusQuery = <TData = EdgeFunctionServiceSta
{
enabled = true,
...options
- }: UseQueryOptions<EdgeFunctionServiceStatusData, EdgeFunctionServiceStatusError, TData> = {}
+ }: UseCustomQueryOptions<
+ EdgeFunctionServiceStatusData,
+ EdgeFunctionServiceStatusError,
+ TData
+ > = {}
) =>
useQuery<EdgeFunctionServiceStatusData, EdgeFunctionServiceStatusError, TData>({
queryKey: serviceStatusKeys.edgeFunctions(projectRef),
diff --git a/apps/studio/data/service-status/service-status-query.ts b/apps/studio/data/service-status/service-status-query.ts
index 2ae7ea79089..38d481bbdd6 100644
--- a/apps/studio/data/service-status/service-status-query.ts
+++ b/apps/studio/data/service-status/service-status-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { serviceStatusKeys } from './keys'
export type ProjectServiceStatusVariables = {
@@ -37,7 +37,7 @@ export const useProjectServiceStatusQuery = <TData = ProjectServiceStatusData>(
{
enabled = true,
...options
- }: UseQueryOptions<ProjectServiceStatusData, ProjectServiceStatusError, TData> = {}
+ }: UseCustomQueryOptions<ProjectServiceStatusData, ProjectServiceStatusError, TData> = {}
) =>
useQuery<ProjectServiceStatusData, ProjectServiceStatusError, TData>({
queryKey: serviceStatusKeys.serviceStatus(projectRef),
diff --git a/apps/studio/data/sql/abort-query-mutation.ts b/apps/studio/data/sql/abort-query-mutation.ts
index 34acbce8ccf..bbfc5b7d9e4 100644
--- a/apps/studio/data/sql/abort-query-mutation.ts
+++ b/apps/studio/data/sql/abort-query-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { sqlKeys } from './keys'
export type QueryAbortVariables = {
@@ -24,7 +24,7 @@ export const useQueryAbortMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<QueryAbortData, ResponseError, QueryAbortVariables>,
+ UseCustomMutationOptions<QueryAbortData, ResponseError, QueryAbortVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/sql/execute-sql-mutation.ts b/apps/studio/data/sql/execute-sql-mutation.ts
index 575d3227b68..b687c71bb3f 100644
--- a/apps/studio/data/sql/execute-sql-mutation.ts
+++ b/apps/studio/data/sql/execute-sql-mutation.ts
@@ -1,10 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { sqlEventParser } from 'lib/sql-event-parser'
import { executeSql, ExecuteSqlData, ExecuteSqlVariables } from './execute-sql-query'
+import { UseCustomMutationOptions } from 'types'
// [Joshen] Intention is that we invalidate all database related keys whenever running a mutation related query
// So we attempt to ignore all the non-related query keys. We could probably look into grouping our query keys better
@@ -30,7 +31,7 @@ export const useExecuteSqlMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ExecuteSqlData, QueryResponseError, ExecuteSqlVariables>,
+ UseCustomMutationOptions<ExecuteSqlData, QueryResponseError, ExecuteSqlVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/sql/execute-sql-query.ts b/apps/studio/data/sql/execute-sql-query.ts
index 94d7dee7056..cee39cfd3a0 100644
--- a/apps/studio/data/sql/execute-sql-query.ts
+++ b/apps/studio/data/sql/execute-sql-query.ts
@@ -1,4 +1,4 @@
-import { QueryKey, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryKey, useQuery } from '@tanstack/react-query'
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { handleError as handleErrorFetchers, post } from 'data/fetchers'
@@ -8,7 +8,7 @@ import {
ROLE_IMPERSONATION_NO_RESULTS,
ROLE_IMPERSONATION_SQL_LINE_COUNT,
} from 'lib/role-impersonation'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { sqlKeys } from './keys'
export type ExecuteSqlVariables = {
@@ -157,7 +157,7 @@ export const useExecuteSqlQuery = <TData = ExecuteSqlData>(
handleError,
isRoleImpersonationEnabled,
}: ExecuteSqlVariables,
- { enabled = true, ...options }: UseQueryOptions<ExecuteSqlData, ExecuteSqlError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ExecuteSqlData, ExecuteSqlError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/sql/ongoing-queries-query.ts b/apps/studio/data/sql/ongoing-queries-query.ts
index 6d981fc27a2..9c258aba9b7 100644
--- a/apps/studio/data/sql/ongoing-queries-query.ts
+++ b/apps/studio/data/sql/ongoing-queries-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { sqlKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type OngoingQuery = {
pid: number
@@ -43,7 +44,7 @@ export const useOngoingQueriesQuery = <TData = OngoingQueriesData>(
{
enabled = true,
...options
- }: UseQueryOptions<OngoingQueriesData, OngoingQueriesError, TData> = {}
+ }: UseCustomQueryOptions<OngoingQueriesData, OngoingQueriesError, TData> = {}
) =>
useQuery<OngoingQueriesData, OngoingQueriesError, TData>({
queryKey: sqlKeys.ongoingQueries(projectRef),
diff --git a/apps/studio/data/ssl-enforcement/ssl-enforcement-query.ts b/apps/studio/data/ssl-enforcement/ssl-enforcement-query.ts
index c9888ee0163..3a8b9228d86 100644
--- a/apps/studio/data/ssl-enforcement/ssl-enforcement-query.ts
+++ b/apps/studio/data/ssl-enforcement/ssl-enforcement-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { sslEnforcementKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
export type SSLEnforcementVariables = { projectRef?: string }
@@ -44,7 +45,7 @@ export const useSSLEnforcementQuery = <TData = SSLEnforcementData>(
{
enabled = true,
...options
- }: UseQueryOptions<SSLEnforcementData, SSLEnforcementError, TData> = {}
+ }: UseCustomQueryOptions<SSLEnforcementData, SSLEnforcementError, TData> = {}
) =>
useQuery<SSLEnforcementData, SSLEnforcementError, TData>({
queryKey: sslEnforcementKeys.list(projectRef),
diff --git a/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts b/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts
index 30149f874e0..b4398355e9e 100644
--- a/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts
+++ b/apps/studio/data/ssl-enforcement/ssl-enforcement-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { sslEnforcementKeys } from './keys'
export type SSLEnforcementUpdateVariables = {
@@ -38,7 +38,7 @@ export const useSSLEnforcementUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SSLEnforcementUpdateData, ResponseError, SSLEnforcementUpdateVariables>,
+ UseCustomMutationOptions<SSLEnforcementUpdateData, ResponseError, SSLEnforcementUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/sso/sso-config-create-mutation.ts b/apps/studio/data/sso/sso-config-create-mutation.ts
index e631057715b..241935f6dc6 100644
--- a/apps/studio/data/sso/sso-config-create-mutation.ts
+++ b/apps/studio/data/sso/sso-config-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { orgSSOKeys } from './keys'
export type SSOConfigCreateVariables = {
@@ -28,7 +28,7 @@ export const useSSOConfigCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SSOConfigCreateData, ResponseError, SSOConfigCreateVariables>,
+ UseCustomMutationOptions<SSOConfigCreateData, ResponseError, SSOConfigCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/sso/sso-config-query.ts b/apps/studio/data/sso/sso-config-query.ts
index 33a4d0ab898..e411d0b2fd4 100644
--- a/apps/studio/data/sso/sso-config-query.ts
+++ b/apps/studio/data/sso/sso-config-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { orgSSOKeys } from './keys'
export type OrgSSOConfigVariables = {
@@ -37,7 +37,10 @@ export type OrgSSOConfigError = ResponseError
export const useOrgSSOConfigQuery = <TData = OrgSSOConfigData>(
{ orgSlug }: OrgSSOConfigVariables,
- { enabled = true, ...options }: UseQueryOptions<OrgSSOConfigData, OrgSSOConfigError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<OrgSSOConfigData, OrgSSOConfigError, TData> = {}
) => {
const { data: organization } = useSelectedOrganizationQuery()
const plan = organization?.plan.id
diff --git a/apps/studio/data/sso/sso-config-update-mutation.ts b/apps/studio/data/sso/sso-config-update-mutation.ts
index cf2bb27a3b2..5bd1eaf87bf 100644
--- a/apps/studio/data/sso/sso-config-update-mutation.ts
+++ b/apps/studio/data/sso/sso-config-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'data/api'
import { handleError, put } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { orgSSOKeys } from './keys'
export type SSOConfigUpdateVariables = {
@@ -28,7 +28,7 @@ export const useSSOConfigUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SSOConfigUpdateData, ResponseError, SSOConfigUpdateVariables>,
+ UseCustomMutationOptions<SSOConfigUpdateData, ResponseError, SSOConfigUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/analytics-bucket-create-mutation.ts b/apps/studio/data/storage/analytics-bucket-create-mutation.ts
index 55d9a081ee3..539bf1f7005 100644
--- a/apps/studio/data/storage/analytics-bucket-create-mutation.ts
+++ b/apps/studio/data/storage/analytics-bucket-create-mutation.ts
@@ -1,6 +1,6 @@
// @ts-nocheck
// [Joshen] To remove after infra changes for analytics bucket is in
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
@@ -34,7 +34,11 @@ export const useAnalyticsBucketCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AnalyticsBucketCreateData, ResponseError, AnalyticsBucketCreateVariables>,
+ UseCustomMutationOptions<
+ AnalyticsBucketCreateData,
+ ResponseError,
+ AnalyticsBucketCreateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/analytics-bucket-delete-mutation.ts b/apps/studio/data/storage/analytics-bucket-delete-mutation.ts
index d71105d2b78..e2930b5d30e 100644
--- a/apps/studio/data/storage/analytics-bucket-delete-mutation.ts
+++ b/apps/studio/data/storage/analytics-bucket-delete-mutation.ts
@@ -1,6 +1,6 @@
// @ts-nocheck
// [Joshen] To remove after infra changes for analytics bucket is in
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { useIsNewStorageUIEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext'
@@ -32,7 +32,11 @@ export const useAnalyticsBucketDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<AnalyticsBucketDeleteData, ResponseError, AnalyticsBucketDeleteVariables>,
+ UseCustomMutationOptions<
+ AnalyticsBucketDeleteData,
+ ResponseError,
+ AnalyticsBucketDeleteVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/analytics-buckets-query.ts b/apps/studio/data/storage/analytics-buckets-query.ts
index 03fd2c7e65b..ce0ed16ab8c 100644
--- a/apps/studio/data/storage/analytics-buckets-query.ts
+++ b/apps/studio/data/storage/analytics-buckets-query.ts
@@ -1,6 +1,6 @@
// @ts-nocheck
// [Joshen] To remove after infra changes for analytics bucket is in
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
@@ -36,7 +36,7 @@ export const useAnalyticsBucketsQuery = <TData = AnalyticsBucketsData>(
{
enabled = true,
...options
- }: UseQueryOptions<AnalyticsBucketsData, AnalyticsBucketsError, TData> = {}
+ }: UseCustomQueryOptions<AnalyticsBucketsData, AnalyticsBucketsError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/storage/bucket-create-mutation.ts b/apps/studio/data/storage/bucket-create-mutation.ts
index 5199c50f119..cbfbf784996 100644
--- a/apps/studio/data/storage/bucket-create-mutation.ts
+++ b/apps/studio/data/storage/bucket-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
type BucketCreateVariables = Omit<CreateStorageBucketBody, 'public'> & {
@@ -46,7 +46,7 @@ export const useBucketCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketCreateData, ResponseError, BucketCreateVariables>,
+ UseCustomMutationOptions<BucketCreateData, ResponseError, BucketCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/bucket-delete-mutation.ts b/apps/studio/data/storage/bucket-delete-mutation.ts
index 7586d152453..3e69ef78a00 100644
--- a/apps/studio/data/storage/bucket-delete-mutation.ts
+++ b/apps/studio/data/storage/bucket-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
type BucketDeleteVariables = {
@@ -34,7 +34,7 @@ export const useBucketDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketDeleteData, ResponseError, BucketDeleteVariables>,
+ UseCustomMutationOptions<BucketDeleteData, ResponseError, BucketDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/bucket-empty-mutation.ts b/apps/studio/data/storage/bucket-empty-mutation.ts
index 6598028c813..a3aaeb5926f 100644
--- a/apps/studio/data/storage/bucket-empty-mutation.ts
+++ b/apps/studio/data/storage/bucket-empty-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
export type BucketEmptyVariables = {
@@ -29,7 +29,7 @@ export const useBucketEmptyMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketEmptyData, ResponseError, BucketEmptyVariables>,
+ UseCustomMutationOptions<BucketEmptyData, ResponseError, BucketEmptyVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/bucket-object-delete-mutation.ts b/apps/studio/data/storage/bucket-object-delete-mutation.ts
index 2554d7feedb..3d692fa9c5b 100644
--- a/apps/studio/data/storage/bucket-object-delete-mutation.ts
+++ b/apps/studio/data/storage/bucket-object-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { UseMutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { del, handleError } from 'data/fetchers'
import { toast } from 'sonner'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type DeleteBucketObjectParams = {
projectRef: string
@@ -39,7 +39,7 @@ export const useBucketObjectDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketObjectDeleteData, ResponseError, DeleteBucketObjectParams>,
+ UseCustomMutationOptions<BucketObjectDeleteData, ResponseError, DeleteBucketObjectParams>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/bucket-object-download-mutation.ts b/apps/studio/data/storage/bucket-object-download-mutation.ts
index 5fb6df6752d..7e9bcc3b4ac 100644
--- a/apps/studio/data/storage/bucket-object-download-mutation.ts
+++ b/apps/studio/data/storage/bucket-object-download-mutation.ts
@@ -1,10 +1,10 @@
-import { UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'data/api'
import { fetchPost } from 'data/fetchers'
import { API_URL, IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type DownloadBucketObjectParams = {
projectRef: string
@@ -34,7 +34,7 @@ export const useBucketObjectDownloadMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketObjectDeleteData, ResponseError, DownloadBucketObjectParams>,
+ UseCustomMutationOptions<BucketObjectDeleteData, ResponseError, DownloadBucketObjectParams>,
'mutationFn'
> = {}) => {
return useMutation<BucketObjectDeleteData, ResponseError, DownloadBucketObjectParams>({
diff --git a/apps/studio/data/storage/bucket-object-get-public-url-mutation.ts b/apps/studio/data/storage/bucket-object-get-public-url-mutation.ts
index d9b3274d83f..88718fa9926 100644
--- a/apps/studio/data/storage/bucket-object-get-public-url-mutation.ts
+++ b/apps/studio/data/storage/bucket-object-get-public-url-mutation.ts
@@ -1,9 +1,9 @@
-import { UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type BucketObjectPublicUrlParams = {
projectRef: string
@@ -39,7 +39,7 @@ export const useGetBucketObjectPublicUrlMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketObjectPublicUrlData, ResponseError, BucketObjectPublicUrlParams>,
+ UseCustomMutationOptions<BucketObjectPublicUrlData, ResponseError, BucketObjectPublicUrlParams>,
'mutationFn'
> = {}) => {
return useMutation<BucketObjectPublicUrlData, ResponseError, BucketObjectPublicUrlParams>({
diff --git a/apps/studio/data/storage/bucket-object-sign-mutation.ts b/apps/studio/data/storage/bucket-object-sign-mutation.ts
index 82e0435f90b..cfb00628e44 100644
--- a/apps/studio/data/storage/bucket-object-sign-mutation.ts
+++ b/apps/studio/data/storage/bucket-object-sign-mutation.ts
@@ -1,9 +1,9 @@
-import { UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type SignBucketObjectParams = {
projectRef: string
@@ -40,7 +40,7 @@ export const useGetSignBucketObjectMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<SignBucketObjectData, ResponseError, SignBucketObjectParams>,
+ UseCustomMutationOptions<SignBucketObjectData, ResponseError, SignBucketObjectParams>,
'mutationFn'
> = {}) => {
return useMutation<SignBucketObjectData, ResponseError, SignBucketObjectParams>({
diff --git a/apps/studio/data/storage/bucket-objects-list-mutation.ts b/apps/studio/data/storage/bucket-objects-list-mutation.ts
index 1fe470e4ac1..3e1ba39f8b5 100644
--- a/apps/studio/data/storage/bucket-objects-list-mutation.ts
+++ b/apps/studio/data/storage/bucket-objects-list-mutation.ts
@@ -1,9 +1,9 @@
-import { UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'data/api'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type ListBucketObjectsParams = {
projectRef: string
@@ -46,7 +46,7 @@ export const useGetSignBucketObjectMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ListBucketObjectsData, ResponseError, ListBucketObjectsParams>,
+ UseCustomMutationOptions<ListBucketObjectsData, ResponseError, ListBucketObjectsParams>,
'mutationFn'
> = {}) => {
return useMutation<ListBucketObjectsData, ResponseError, ListBucketObjectsParams>({
diff --git a/apps/studio/data/storage/bucket-update-mutation.ts b/apps/studio/data/storage/bucket-update-mutation.ts
index 63dfcfcd31f..512d3fe11b8 100644
--- a/apps/studio/data/storage/bucket-update-mutation.ts
+++ b/apps/studio/data/storage/bucket-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { patch } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
type BucketUpdateVariables = {
@@ -58,7 +58,7 @@ export const useBucketUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<BucketUpdateData, ResponseError, BucketUpdateVariables>,
+ UseCustomMutationOptions<BucketUpdateData, ResponseError, BucketUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/buckets-query.ts b/apps/studio/data/storage/buckets-query.ts
index 621e069d9d4..0cb30a07c19 100644
--- a/apps/studio/data/storage/buckets-query.ts
+++ b/apps/studio/data/storage/buckets-query.ts
@@ -1,10 +1,10 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { PROJECT_STATUS } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageKeys } from './keys'
export type BucketsVariables = { projectRef?: string }
@@ -30,7 +30,7 @@ export type BucketsError = ResponseError
export const useBucketsQuery = <TData = BucketsData>(
{ projectRef }: BucketsVariables,
- { enabled = true, ...options }: UseQueryOptions<BucketsData, BucketsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<BucketsData, BucketsError, TData> = {}
) => {
const { data: project } = useSelectedProjectQuery()
const isActive = project?.status === PROJECT_STATUS.ACTIVE_HEALTHY
diff --git a/apps/studio/data/storage/iceberg-namespace-create-mutation.ts b/apps/studio/data/storage/iceberg-namespace-create-mutation.ts
index 8b8010a4c8e..ce1a74696f3 100644
--- a/apps/studio/data/storage/iceberg-namespace-create-mutation.ts
+++ b/apps/studio/data/storage/iceberg-namespace-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { constructHeaders, fetchHandler, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
type CreateIcebergNamespaceVariables = {
@@ -65,7 +65,11 @@ export const useIcebergNamespaceCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<IcebergNamespaceCreateData, ResponseError, CreateIcebergNamespaceVariables>,
+ UseCustomMutationOptions<
+ IcebergNamespaceCreateData,
+ ResponseError,
+ CreateIcebergNamespaceVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/iceberg-namespace-exists-query.ts b/apps/studio/data/storage/iceberg-namespace-exists-query.ts
index 619ec73f6a4..b05e1eee118 100644
--- a/apps/studio/data/storage/iceberg-namespace-exists-query.ts
+++ b/apps/studio/data/storage/iceberg-namespace-exists-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { constructHeaders, fetchHandler, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageKeys } from './keys'
type ExistsNamespaceVariables = {
@@ -54,7 +54,7 @@ export const useIcebergNamespaceExistsQuery = <TData = IcebergNamespaceExistsDat
params: ExistsNamespaceVariables,
{
...options
- }: UseQueryOptions<IcebergNamespaceExistsData, IcebergNamespaceExistsError, TData> = {}
+ }: UseCustomQueryOptions<IcebergNamespaceExistsData, IcebergNamespaceExistsError, TData> = {}
) => {
return useQuery<IcebergNamespaceExistsData, IcebergNamespaceExistsError, TData>({
queryKey: storageKeys.icebergNamespace(params.catalogUri, params.warehouse, params.namespace),
diff --git a/apps/studio/data/storage/iceberg-namespace-tables-query.ts b/apps/studio/data/storage/iceberg-namespace-tables-query.ts
index 2e642578060..6fe81e573f8 100644
--- a/apps/studio/data/storage/iceberg-namespace-tables-query.ts
+++ b/apps/studio/data/storage/iceberg-namespace-tables-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { constructHeaders, fetchHandler, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageKeys } from './keys'
type GetNamespaceTablesVariables = {
@@ -65,7 +65,7 @@ export const useIcebergNamespaceTablesQuery = <TData = IcebergNamespaceTablesDat
params: GetNamespaceTablesVariables,
{
...options
- }: UseQueryOptions<IcebergNamespaceTablesData, IcebergNamespaceTablesError, TData> = {}
+ }: UseCustomQueryOptions<IcebergNamespaceTablesData, IcebergNamespaceTablesError, TData> = {}
) => {
return useQuery<IcebergNamespaceTablesData, IcebergNamespaceTablesError, TData>({
queryKey: storageKeys.icebergNamespaceTables(
diff --git a/apps/studio/data/storage/iceberg-namespaces-query.ts b/apps/studio/data/storage/iceberg-namespaces-query.ts
index 7becfb28c12..035e86c4f8a 100644
--- a/apps/studio/data/storage/iceberg-namespaces-query.ts
+++ b/apps/studio/data/storage/iceberg-namespaces-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { constructHeaders, fetchHandler, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageKeys } from './keys'
type GetNamespacesVariables = {
@@ -55,7 +55,7 @@ export type IcebergNamespacesError = ResponseError
export const useIcebergNamespacesQuery = <TData = IcebergNamespacesData>(
params: GetNamespacesVariables,
- { ...options }: UseQueryOptions<IcebergNamespacesData, IcebergNamespacesError, TData> = {}
+ { ...options }: UseCustomQueryOptions<IcebergNamespacesData, IcebergNamespacesError, TData> = {}
) => {
return useQuery<IcebergNamespacesData, IcebergNamespacesError, TData>({
queryKey: storageKeys.icebergNamespaces(params.catalogUri, params.warehouse),
diff --git a/apps/studio/data/storage/object-move-mutation.ts b/apps/studio/data/storage/object-move-mutation.ts
index 7994f95ceeb..f1869fb523e 100644
--- a/apps/studio/data/storage/object-move-mutation.ts
+++ b/apps/studio/data/storage/object-move-mutation.ts
@@ -1,8 +1,8 @@
-import { UseMutationOptions, useMutation } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
type MoveStorageObjectParams = {
projectRef: string
@@ -42,7 +42,7 @@ export const useGetSignBucketObjectMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<MoveBucketObjectData, ResponseError, MoveStorageObjectParams>,
+ UseCustomMutationOptions<MoveBucketObjectData, ResponseError, MoveStorageObjectParams>,
'mutationFn'
> = {}) => {
return useMutation<MoveBucketObjectData, ResponseError, MoveStorageObjectParams>({
diff --git a/apps/studio/data/storage/s3-access-key-create-mutation.ts b/apps/studio/data/storage/s3-access-key-create-mutation.ts
index 68699bbcfe9..362d47ef557 100644
--- a/apps/studio/data/storage/s3-access-key-create-mutation.ts
+++ b/apps/studio/data/storage/s3-access-key-create-mutation.ts
@@ -1,8 +1,8 @@
-import { UseMutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageCredentialsKeys } from './s3-access-key-keys'
type CreateS3AccessKeyCredentialVariables = {
@@ -32,7 +32,11 @@ export function useS3AccessKeyCreateMutation({
onError,
...options
}: Omit<
- UseMutationOptions<S3AccessKeyCreateData, ResponseError, CreateS3AccessKeyCredentialVariables>,
+ UseCustomMutationOptions<
+ S3AccessKeyCreateData,
+ ResponseError,
+ CreateS3AccessKeyCredentialVariables
+ >,
'mutationFn'
> = {}) {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/s3-access-key-delete-mutation.ts b/apps/studio/data/storage/s3-access-key-delete-mutation.ts
index 1e92a9954ef..da77560d205 100644
--- a/apps/studio/data/storage/s3-access-key-delete-mutation.ts
+++ b/apps/studio/data/storage/s3-access-key-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { UseMutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageCredentialsKeys } from './s3-access-key-keys'
type S3AccessKeyDeleteVariables = {
@@ -35,7 +35,7 @@ export function useS3AccessKeyDeleteMutation({
onError,
...options
}: Omit<
- UseMutationOptions<S3AccessKeyDeleteData, ResponseError, S3AccessKeyDeleteVariables>,
+ UseCustomMutationOptions<S3AccessKeyDeleteData, ResponseError, S3AccessKeyDeleteVariables>,
'mutationFn'
> = {}) {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/s3-access-key-query.ts b/apps/studio/data/storage/s3-access-key-query.ts
index bf5990c4aaf..9f1a11962f4 100644
--- a/apps/studio/data/storage/s3-access-key-query.ts
+++ b/apps/studio/data/storage/s3-access-key-query.ts
@@ -1,9 +1,9 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageCredentialsKeys } from './s3-access-key-keys'
type StorageCredentialsVariables = { projectRef?: string }
@@ -31,7 +31,10 @@ export type StorageCredentialsData = Awaited<ReturnType<typeof fetchStorageCrede
export const useStorageCredentialsQuery = <TData = StorageCredentialsData>(
{ projectRef }: StorageCredentialsVariables,
- { enabled = true, ...options }: UseQueryOptions<StorageCredentialsData, ResponseError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<StorageCredentialsData, ResponseError, TData> = {}
) =>
useQuery<StorageCredentialsData, ResponseError, TData>({
queryKey: storageCredentialsKeys.credentials(projectRef),
diff --git a/apps/studio/data/storage/storage-archive-create-mutation.ts b/apps/studio/data/storage/storage-archive-create-mutation.ts
index 473502dc99e..e1ade6a6ff5 100644
--- a/apps/studio/data/storage/storage-archive-create-mutation.ts
+++ b/apps/studio/data/storage/storage-archive-create-mutation.ts
@@ -1,8 +1,8 @@
-import { UseMutationOptions, useMutation, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { storageKeys } from './keys'
type StorageArchiveCreateVariables = {
@@ -27,7 +27,7 @@ export function useStorageArchiveCreateMutation({
onError,
...options
}: Omit<
- UseMutationOptions<StorageArchiveCreateData, ResponseError, StorageArchiveCreateVariables>,
+ UseCustomMutationOptions<StorageArchiveCreateData, ResponseError, StorageArchiveCreateVariables>,
'mutationFn'
> = {}) {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/storage/storage-archive-query.ts b/apps/studio/data/storage/storage-archive-query.ts
index c5d715c383c..7eeabe1a790 100644
--- a/apps/studio/data/storage/storage-archive-query.ts
+++ b/apps/studio/data/storage/storage-archive-query.ts
@@ -1,7 +1,7 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { storageKeys } from './keys'
type StorageArchiveVariables = { projectRef?: string }
@@ -27,7 +27,10 @@ export type StorageArchiveData = Awaited<ReturnType<typeof fetchStorageArchive>>
export const useStorageArchiveQuery = <TData = StorageArchiveData>(
{ projectRef }: StorageArchiveVariables,
- { enabled = true, ...options }: UseQueryOptions<StorageArchiveData, ResponseError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<StorageArchiveData, ResponseError, TData> = {}
) =>
useQuery<StorageArchiveData, ResponseError, TData>({
queryKey: storageKeys.archive(projectRef),
diff --git a/apps/studio/data/stripe/setup-intent-mutation.ts b/apps/studio/data/stripe/setup-intent-mutation.ts
index 6cae09272f6..68caf34d4a1 100644
--- a/apps/studio/data/stripe/setup-intent-mutation.ts
+++ b/apps/studio/data/stripe/setup-intent-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { components } from 'api-types'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type SetupIntentVariables = {
hcaptchaToken: string
@@ -26,7 +26,7 @@ export const useSetupIntent = ({
onError,
...options
}: Omit<
- UseMutationOptions<SetupIntentData, ResponseError, SetupIntentVariables>,
+ UseCustomMutationOptions<SetupIntentData, ResponseError, SetupIntentVariables>,
'mutationFn'
> = {}) => {
return useMutation<SetupIntentData, ResponseError, SetupIntentVariables>({
diff --git a/apps/studio/data/subscriptions/org-plans-query.ts b/apps/studio/data/subscriptions/org-plans-query.ts
index 502b2c420b3..d7239cc44ee 100644
--- a/apps/studio/data/subscriptions/org-plans-query.ts
+++ b/apps/studio/data/subscriptions/org-plans-query.ts
@@ -1,8 +1,9 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
+import { UseCustomQueryOptions } from 'types'
import { subscriptionKeys } from './keys'
export type OrgPlansVariables = {
@@ -25,7 +26,7 @@ export type OrgPlansError = unknown
export const useOrgPlansQuery = <TData = OrgPlansData>(
{ orgSlug }: OrgPlansVariables,
- { enabled = true, ...options }: UseQueryOptions<OrgPlansData, OrgPlansError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<OrgPlansData, OrgPlansError, TData> = {}
) => {
const { can: canReadSubscriptions } = useAsyncCheckPermissions(
PermissionAction.BILLING_READ,
diff --git a/apps/studio/data/subscriptions/org-subscription-confirm-pending-change.ts b/apps/studio/data/subscriptions/org-subscription-confirm-pending-change.ts
index 564429b392e..82d1e2794c6 100644
--- a/apps/studio/data/subscriptions/org-subscription-confirm-pending-change.ts
+++ b/apps/studio/data/subscriptions/org-subscription-confirm-pending-change.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
@@ -6,7 +6,7 @@ import { handleError, post } from 'data/fetchers'
import { invoicesKeys } from 'data/invoices/keys'
import { organizationKeys } from 'data/organizations/keys'
import { usageKeys } from 'data/usage/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { subscriptionKeys } from './keys'
export type PendingSubscriptionChangeVariables = {
@@ -47,7 +47,7 @@ export const useConfirmPendingSubscriptionChangeMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
PendingSubscriptionChangeData,
ResponseError,
PendingSubscriptionChangeVariables
diff --git a/apps/studio/data/subscriptions/org-subscription-confirm-pending-create.ts b/apps/studio/data/subscriptions/org-subscription-confirm-pending-create.ts
index 5124b82bbb0..07054aefcf9 100644
--- a/apps/studio/data/subscriptions/org-subscription-confirm-pending-create.ts
+++ b/apps/studio/data/subscriptions/org-subscription-confirm-pending-create.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import type { components } from 'api-types'
@@ -6,7 +6,7 @@ import { handleError, post } from 'data/fetchers'
import { organizationKeys } from 'data/organizations/keys'
import { castOrganizationResponseToOrganization } from 'data/organizations/organizations-query'
import { permissionKeys } from 'data/permissions/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type PendingSubscriptionCreateVariables = {
payment_intent_id: string
@@ -41,7 +41,7 @@ export const useConfirmPendingSubscriptionCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
PendingSubscriptionCreateData,
ResponseError,
PendingSubscriptionCreateVariables
diff --git a/apps/studio/data/subscriptions/org-subscription-query.ts b/apps/studio/data/subscriptions/org-subscription-query.ts
index f8747efb49b..8b3fc04da3e 100644
--- a/apps/studio/data/subscriptions/org-subscription-query.ts
+++ b/apps/studio/data/subscriptions/org-subscription-query.ts
@@ -1,9 +1,9 @@
import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { subscriptionKeys } from './keys'
export type OrgSubscriptionVariables = {
@@ -33,7 +33,7 @@ export const useOrgSubscriptionQuery = <TData = OrgSubscriptionData>(
{
enabled = true,
...options
- }: UseQueryOptions<OrgSubscriptionData, OrgSubscriptionError, TData> = {}
+ }: UseCustomQueryOptions<OrgSubscriptionData, OrgSubscriptionError, TData> = {}
) => {
// [Joshen] Thinking it makes sense to add this check at the RQ level - prevent
// unnecessary requests, although this behaviour still needs handling on the UI
diff --git a/apps/studio/data/subscriptions/org-subscription-update-mutation.ts b/apps/studio/data/subscriptions/org-subscription-update-mutation.ts
index f03dc3777f5..8d17514fcd4 100644
--- a/apps/studio/data/subscriptions/org-subscription-update-mutation.ts
+++ b/apps/studio/data/subscriptions/org-subscription-update-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { handleError, put } from 'data/fetchers'
import { invoicesKeys } from 'data/invoices/keys'
import { organizationKeys } from 'data/organizations/keys'
@@ -8,6 +8,7 @@ import { toast } from 'sonner'
import type { ResponseError } from 'types/base'
import { subscriptionKeys } from './keys'
import type { SubscriptionTier } from './types'
+import { UseCustomMutationOptions } from 'types'
export type OrgSubscriptionUpdateVariables = {
slug: string
@@ -54,7 +55,11 @@ export const useOrgSubscriptionUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<OrgSubscriptionUpdateData, ResponseError, OrgSubscriptionUpdateVariables>,
+ UseCustomMutationOptions<
+ OrgSubscriptionUpdateData,
+ ResponseError,
+ OrgSubscriptionUpdateVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/subscriptions/project-addon-remove-mutation.ts b/apps/studio/data/subscriptions/project-addon-remove-mutation.ts
index d842c89ecf6..077d21b0144 100644
--- a/apps/studio/data/subscriptions/project-addon-remove-mutation.ts
+++ b/apps/studio/data/subscriptions/project-addon-remove-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { subscriptionKeys } from './keys'
import type { AddonVariantId } from './types'
@@ -38,7 +38,7 @@ export const useProjectAddonRemoveMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectAddonRemoveData, ResponseError, ProjectAddonRemoveVariables>,
+ UseCustomMutationOptions<ProjectAddonRemoveData, ResponseError, ProjectAddonRemoveVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/subscriptions/project-addon-update-mutation.ts b/apps/studio/data/subscriptions/project-addon-update-mutation.ts
index c77075da5c1..9765b15071d 100644
--- a/apps/studio/data/subscriptions/project-addon-update-mutation.ts
+++ b/apps/studio/data/subscriptions/project-addon-update-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { subscriptionKeys } from './keys'
import type { AddonVariantId, ProjectAddonType } from './types'
@@ -45,7 +45,7 @@ export const useProjectAddonUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ProjectAddonUpdateData, ResponseError, ProjectAddonUpdateVariables>,
+ UseCustomMutationOptions<ProjectAddonUpdateData, ResponseError, ProjectAddonUpdateVariables>,
'mutationFn'
> & { suppressToast?: boolean } = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/subscriptions/project-addons-query.ts b/apps/studio/data/subscriptions/project-addons-query.ts
index b92c843ae62..b061f037938 100644
--- a/apps/studio/data/subscriptions/project-addons-query.ts
+++ b/apps/studio/data/subscriptions/project-addons-query.ts
@@ -1,8 +1,8 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { subscriptionKeys } from './keys'
export type ProjectAddonsVariables = {
@@ -32,7 +32,10 @@ export type ProjectAddonsError = ResponseError
export const useProjectAddonsQuery = <TData = ProjectAddonsData>(
{ projectRef }: ProjectAddonsVariables,
- { enabled = true, ...options }: UseQueryOptions<ProjectAddonsData, ProjectAddonsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<ProjectAddonsData, ProjectAddonsError, TData> = {}
) =>
useQuery<ProjectAddonsData, ProjectAddonsError, TData>({
queryKey: subscriptionKeys.addons(projectRef),
diff --git a/apps/studio/data/support/generate-attachment-urls-mutation.ts b/apps/studio/data/support/generate-attachment-urls-mutation.ts
index 74e47f003e1..65efe6a6353 100644
--- a/apps/studio/data/support/generate-attachment-urls-mutation.ts
+++ b/apps/studio/data/support/generate-attachment-urls-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { constructHeaders } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type GenerateAttachmentURLsResponse = {
title: string
@@ -52,7 +52,11 @@ export const useGenerateAttachmentURLsMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<GenerateAttachmentURLsData, ResponseError, GenerateAttachmentURLsVariables>,
+ UseCustomMutationOptions<
+ GenerateAttachmentURLsData,
+ ResponseError,
+ GenerateAttachmentURLsVariables
+ >,
'mutationFn'
> = {}) => {
return useMutation<GenerateAttachmentURLsData, ResponseError, GenerateAttachmentURLsVariables>({
diff --git a/apps/studio/data/table-editor/table-editor-query.ts b/apps/studio/data/table-editor/table-editor-query.ts
index f92a7c55241..354456a1dbb 100644
--- a/apps/studio/data/table-editor/table-editor-query.ts
+++ b/apps/studio/data/table-editor/table-editor-query.ts
@@ -1,9 +1,10 @@
-import { QueryClient, useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { tableEditorKeys } from './keys'
import { getTableEditorSql } from './table-editor-query-sql'
import { Entity } from './table-editor-types'
+import { UseCustomQueryOptions } from 'types'
type TableEditorArgs = {
id?: number
@@ -41,7 +42,10 @@ export type TableEditorError = ExecuteSqlError
export const useTableEditorQuery = <TData = TableEditorData>(
{ projectRef, connectionString, id }: TableEditorVariables,
- { enabled = true, ...options }: UseQueryOptions<TableEditorData, TableEditorError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<TableEditorData, TableEditorError, TData> = {}
) =>
useQuery<TableEditorData, TableEditorError, TData>({
queryKey: tableEditorKeys.tableEditor(projectRef, id),
diff --git a/apps/studio/data/table-rows/get-cell-value-mutation.ts b/apps/studio/data/table-rows/get-cell-value-mutation.ts
index c18e319a94b..7cf2454078f 100644
--- a/apps/studio/data/table-rows/get-cell-value-mutation.ts
+++ b/apps/studio/data/table-rows/get-cell-value-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export type GetCellValueVariables = {
projectRef: string
@@ -44,7 +44,7 @@ export const useGetCellValueMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowCreateData, ResponseError, GetCellValueVariables>,
+ UseCustomMutationOptions<TableRowCreateData, ResponseError, GetCellValueVariables>,
'mutationFn'
> = {}) => {
return useMutation<TableRowCreateData, ResponseError, GetCellValueVariables>({
diff --git a/apps/studio/data/table-rows/table-row-create-mutation.ts b/apps/studio/data/table-rows/table-row-create-mutation.ts
index f182bc1c6f6..b242b1eb2e6 100644
--- a/apps/studio/data/table-rows/table-row-create-mutation.ts
+++ b/apps/studio/data/table-rows/table-row-create-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
@@ -7,7 +7,7 @@ import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableRowKeys } from './keys'
export type TableRowCreateVariables = {
@@ -63,7 +63,7 @@ export const useTableRowCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowCreateData, ResponseError, TableRowCreateVariables>,
+ UseCustomMutationOptions<TableRowCreateData, ResponseError, TableRowCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/table-rows/table-row-delete-all-mutation.ts b/apps/studio/data/table-rows/table-row-delete-all-mutation.ts
index fbbc44538fe..fbd0addedc2 100644
--- a/apps/studio/data/table-rows/table-row-delete-all-mutation.ts
+++ b/apps/studio/data/table-rows/table-row-delete-all-mutation.ts
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
@@ -7,7 +7,7 @@ import { executeSql } from 'data/sql/execute-sql-query'
import { Entity } from 'data/table-editor/table-editor-types'
import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableRowKeys } from './keys'
import { formatFilterValue } from './utils'
@@ -67,7 +67,7 @@ export const useTableRowDeleteAllMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowDeleteAllData, ResponseError, TableRowDeleteAllVariables>,
+ UseCustomMutationOptions<TableRowDeleteAllData, ResponseError, TableRowDeleteAllVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/table-rows/table-row-delete-mutation.tsx b/apps/studio/data/table-rows/table-row-delete-mutation.tsx
index 5588dad5f31..44cd66eac91 100644
--- a/apps/studio/data/table-rows/table-row-delete-mutation.tsx
+++ b/apps/studio/data/table-rows/table-row-delete-mutation.tsx
@@ -1,4 +1,4 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
@@ -10,7 +10,7 @@ import { Entity } from 'data/table-editor/table-editor-types'
import { DOCS_URL } from 'lib/constants'
import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableRowKeys } from './keys'
import { getPrimaryKeys } from './utils'
@@ -67,7 +67,7 @@ export const useTableRowDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowDeleteData, ResponseError, TableRowDeleteVariables>,
+ UseCustomMutationOptions<TableRowDeleteData, ResponseError, TableRowDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/table-rows/table-row-truncate-mutation.ts b/apps/studio/data/table-rows/table-row-truncate-mutation.ts
index 9e7657571e8..1a998d54597 100644
--- a/apps/studio/data/table-rows/table-row-truncate-mutation.ts
+++ b/apps/studio/data/table-rows/table-row-truncate-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableRowKeys } from './keys'
export type TableRowTruncateVariables = {
@@ -41,7 +41,7 @@ export const useTableRowTruncateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowTruncateData, ResponseError, TableRowTruncateVariables>,
+ UseCustomMutationOptions<TableRowTruncateData, ResponseError, TableRowTruncateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/table-rows/table-row-update-mutation.ts b/apps/studio/data/table-rows/table-row-update-mutation.ts
index cb3e0985897..8f615247424 100644
--- a/apps/studio/data/table-rows/table-row-update-mutation.ts
+++ b/apps/studio/data/table-rows/table-row-update-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
import { executeSql } from 'data/sql/execute-sql-query'
import { RoleImpersonationState, wrapWithRoleImpersonation } from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableRowKeys } from './keys'
export type TableRowUpdateVariables = {
@@ -69,7 +69,7 @@ export const useTableRowUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableRowUpdateData, ResponseError, TableRowUpdateVariables>,
+ UseCustomMutationOptions<TableRowUpdateData, ResponseError, TableRowUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/table-rows/table-rows-count-query.ts b/apps/studio/data/table-rows/table-rows-count-query.ts
index ccc5a00cb08..4016f7949b5 100644
--- a/apps/studio/data/table-rows/table-rows-count-query.ts
+++ b/apps/studio/data/table-rows/table-rows-count-query.ts
@@ -3,7 +3,7 @@ import {
COUNT_ESTIMATE_SQL,
THRESHOLD_COUNT,
} from '@supabase/pg-meta/src/sql/studio/get-count-estimate'
-import { QueryClient, useQuery, useQueryClient, type UseQueryOptions } from '@tanstack/react-query'
+import { QueryClient, useQuery, useQueryClient } from '@tanstack/react-query'
import { parseSupaTable } from 'components/grid/SupabaseGrid.utils'
import type { Filter, SupaTable } from 'components/grid/types'
@@ -13,6 +13,7 @@ import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { tableRowKeys } from './keys'
import { formatFilterValue } from './utils'
+import { UseCustomQueryOptions } from 'types'
type GetTableRowsCountArgs = {
table?: SupaTable
@@ -145,7 +146,7 @@ export const useTableRowsCountQuery = <TData = TableRowsCountData>(
{
enabled = true,
...options
- }: UseQueryOptions<TableRowsCountData, TableRowsCountError, TData> = {}
+ }: UseCustomQueryOptions<TableRowsCountData, TableRowsCountError, TData> = {}
) => {
const queryClient = useQueryClient()
return useQuery<TableRowsCountData, TableRowsCountError, TData>({
diff --git a/apps/studio/data/table-rows/table-rows-query.ts b/apps/studio/data/table-rows/table-rows-query.ts
index d6afca2f23c..cc96555f9aa 100644
--- a/apps/studio/data/table-rows/table-rows-query.ts
+++ b/apps/studio/data/table-rows/table-rows-query.ts
@@ -1,11 +1,6 @@
import { Query } from '@supabase/pg-meta/src/query'
import { getTableRowsSql } from '@supabase/pg-meta/src/query/table-row-query'
-import {
- useQuery,
- useQueryClient,
- type QueryClient,
- type UseQueryOptions,
-} from '@tanstack/react-query'
+import { useQuery, useQueryClient, type QueryClient } from '@tanstack/react-query'
import { IS_PLATFORM } from 'common'
import { parseSupaTable } from 'components/grid/SupabaseGrid.utils'
@@ -17,10 +12,10 @@ import {
wrapWithRoleImpersonation,
} from 'lib/role-impersonation'
import { isRoleImpersonationEnabled } from 'state/role-impersonation-state'
+import { ResponseError, UseCustomQueryOptions } from 'types'
import { ExecuteSqlError, executeSql } from '../sql/execute-sql-query'
import { tableRowKeys } from './keys'
import { formatFilterValue } from './utils'
-import { ResponseError } from 'types'
export interface GetTableRowsArgs {
table?: SupaTable
@@ -282,7 +277,7 @@ export async function getTableRows(
export const useTableRowsQuery = <TData = TableRowsData>(
{ projectRef, connectionString, tableId, ...args }: Omit<TableRowsVariables, 'queryClient'>,
- { enabled = true, ...options }: UseQueryOptions<TableRowsData, TableRowsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<TableRowsData, TableRowsError, TData> = {}
) => {
const queryClient = useQueryClient()
return useQuery<TableRowsData, TableRowsError, TData>({
diff --git a/apps/studio/data/tables/table-create-mutation.ts b/apps/studio/data/tables/table-create-mutation.ts
index 3a3717c5a93..eb2a22bfd14 100644
--- a/apps/studio/data/tables/table-create-mutation.ts
+++ b/apps/studio/data/tables/table-create-mutation.ts
@@ -1,9 +1,9 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableKeys } from './keys'
export type CreateTableBody = {
@@ -39,7 +39,7 @@ export const useTableCreateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableCreateData, ResponseError, TableCreateVariables>,
+ UseCustomMutationOptions<TableCreateData, ResponseError, TableCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/tables/table-delete-mutation.ts b/apps/studio/data/tables/table-delete-mutation.ts
index 79499c42387..cf68bcce577 100644
--- a/apps/studio/data/tables/table-delete-mutation.ts
+++ b/apps/studio/data/tables/table-delete-mutation.ts
@@ -1,12 +1,12 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { entityTypeKeys } from 'data/entity-types/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { tableEditorKeys } from 'data/table-editor/keys'
import { viewKeys } from 'data/views/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableKeys } from './keys'
export type TableDeleteVariables = {
@@ -45,7 +45,7 @@ export const useTableDeleteMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableDeleteData, ResponseError, TableDeleteVariables>,
+ UseCustomMutationOptions<TableDeleteData, ResponseError, TableDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/tables/table-retrieve-query.ts b/apps/studio/data/tables/table-retrieve-query.ts
index 34f9f173f10..219860136e1 100644
--- a/apps/studio/data/tables/table-retrieve-query.ts
+++ b/apps/studio/data/tables/table-retrieve-query.ts
@@ -1,8 +1,8 @@
import pgMeta from '@supabase/pg-meta'
-import { useQuery, type UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { tableKeys } from './keys'
export type TablesVariables = {
@@ -39,7 +39,7 @@ export const useTablesQuery = <TData = RetrieveTableResult>(
{
enabled = true,
...options
- }: UseQueryOptions<RetrieveTableResult, RetrieveTableError, TData> = {}
+ }: UseCustomQueryOptions<RetrieveTableResult, RetrieveTableError, TData> = {}
) => {
return useQuery<RetrieveTableResult, RetrieveTableError, TData>({
queryKey: tableKeys.retrieve(projectRef, name, schema),
diff --git a/apps/studio/data/tables/table-update-mutation.ts b/apps/studio/data/tables/table-update-mutation.ts
index 7b8ce1134b1..fc65061fe8a 100644
--- a/apps/studio/data/tables/table-update-mutation.ts
+++ b/apps/studio/data/tables/table-update-mutation.ts
@@ -1,11 +1,11 @@
import pgMeta from '@supabase/pg-meta'
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { lintKeys } from 'data/lint/keys'
import { executeSql } from 'data/sql/execute-sql-query'
import { tableEditorKeys } from 'data/table-editor/keys'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { tableKeys } from './keys'
import { CreateTableBody } from './table-create-mutation'
@@ -53,7 +53,7 @@ export const useTableUpdateMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<TableUpdateData, ResponseError, TableUpdateVariables>,
+ UseCustomMutationOptions<TableUpdateData, ResponseError, TableUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/tables/tables-query.ts b/apps/studio/data/tables/tables-query.ts
index 5e9c35895ef..f0923b3ecc7 100644
--- a/apps/studio/data/tables/tables-query.ts
+++ b/apps/studio/data/tables/tables-query.ts
@@ -1,11 +1,11 @@
import type { PostgresTable } from '@supabase/postgres-meta'
-import { useQuery, useQueryClient, type UseQueryOptions } from '@tanstack/react-query'
+import { useQuery, useQueryClient } from '@tanstack/react-query'
import { sortBy } from 'lodash'
import { useCallback } from 'react'
import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { tableKeys } from './keys'
export type TablesVariables = {
@@ -72,7 +72,7 @@ export type TablesError = ResponseError
export const useTablesQuery = <TData = TablesData>(
{ projectRef, connectionString, schema, includeColumns }: TablesVariables,
- { enabled = true, ...options }: UseQueryOptions<TablesData, TablesError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<TablesData, TablesError, TData> = {}
) => {
return useQuery<TablesData, TablesError, TData>({
queryKey: tableKeys.list(projectRef, schema, includeColumns),
diff --git a/apps/studio/data/tables/tables-roles-access-query.ts b/apps/studio/data/tables/tables-roles-access-query.ts
index 70bd5e0fc2a..32f5255f3b1 100644
--- a/apps/studio/data/tables/tables-roles-access-query.ts
+++ b/apps/studio/data/tables/tables-roles-access-query.ts
@@ -1,8 +1,9 @@
import { getTablesWithAnonAuthenticatedAccessSQL } from '@supabase/pg-meta/src/sql/studio/check-tables-anon-authenticated-access'
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { tableKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
type TablesRolesAccessArgs = {
schema: string
@@ -37,7 +38,7 @@ export const useTablesRolesAccessQuery = <TData = TablesRolesAccessData>(
{
enabled = true,
...options
- }: UseQueryOptions<TablesRolesAccessData, TablesRolesAccessError, TData> = {}
+ }: UseCustomQueryOptions<TablesRolesAccessData, TablesRolesAccessError, TData> = {}
) =>
useQuery<TablesRolesAccessData, TablesRolesAccessError, TData>({
queryKey: tableKeys.rolesAccess(projectRef, schema),
diff --git a/apps/studio/data/telemetry/send-event-mutation.ts b/apps/studio/data/telemetry/send-event-mutation.ts
index 1968853b7d2..68ad02967b4 100644
--- a/apps/studio/data/telemetry/send-event-mutation.ts
+++ b/apps/studio/data/telemetry/send-event-mutation.ts
@@ -1,11 +1,11 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { sendTelemetryEvent } from 'common'
import { TelemetryEvent } from 'common/telemetry-constants'
import { handleError } from 'data/fetchers'
import { API_URL } from 'lib/constants'
import { useRouter } from 'next/router'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
interface SendEventVariables {
event: TelemetryEvent
@@ -26,7 +26,10 @@ export const useSendEventMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<SendEventData, ResponseError, TelemetryEvent>, 'mutationFn'> = {}) => {
+}: Omit<
+ UseCustomMutationOptions<SendEventData, ResponseError, TelemetryEvent>,
+ 'mutationFn'
+> = {}) => {
const router = useRouter()
return useMutation<SendEventData, ResponseError, TelemetryEvent>({
diff --git a/apps/studio/data/telemetry/send-reset-mutation.ts b/apps/studio/data/telemetry/send-reset-mutation.ts
index b22b19a3880..7d609358883 100644
--- a/apps/studio/data/telemetry/send-reset-mutation.ts
+++ b/apps/studio/data/telemetry/send-reset-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions } from '@tanstack/react-query'
+import { useMutation } from '@tanstack/react-query'
import { handleError, post } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
export async function sendReset() {
if (!IS_PLATFORM) return undefined
@@ -18,7 +18,7 @@ export const useSendResetMutation = ({
onSuccess,
onError,
...options
-}: Omit<UseMutationOptions<SendResetData, ResponseError>, 'mutationFn'> = {}) => {
+}: Omit<UseCustomMutationOptions<SendResetData, ResponseError>, 'mutationFn'> = {}) => {
return useMutation<SendResetData, ResponseError>({
mutationFn: () => sendReset(),
async onSuccess(data, variables, context) {
diff --git a/apps/studio/data/third-party-auth/integration-create-mutation.ts b/apps/studio/data/third-party-auth/integration-create-mutation.ts
index ab1d4d67cd7..571dbba49b7 100644
--- a/apps/studio/data/third-party-auth/integration-create-mutation.ts
+++ b/apps/studio/data/third-party-auth/integration-create-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { handleError, post } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { keys } from './keys'
export type CreateThirdPartyAuthVariables = {
@@ -42,7 +42,11 @@ export const useCreateThirdPartyAuthIntegrationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<ThirdPartyIntegrationCreateData, ResponseError, CreateThirdPartyAuthVariables>,
+ UseCustomMutationOptions<
+ ThirdPartyIntegrationCreateData,
+ ResponseError,
+ CreateThirdPartyAuthVariables
+ >,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/third-party-auth/integration-delete-mutation.ts b/apps/studio/data/third-party-auth/integration-delete-mutation.ts
index 493c91eec57..e703a26c0fa 100644
--- a/apps/studio/data/third-party-auth/integration-delete-mutation.ts
+++ b/apps/studio/data/third-party-auth/integration-delete-mutation.ts
@@ -1,8 +1,8 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { del, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { keys } from './keys'
export type DeleteThirdPartyAuthIntegrationVariables = {
@@ -33,7 +33,7 @@ export const useDeleteThirdPartyAuthIntegrationMutation = ({
onError,
...options
}: Omit<
- UseMutationOptions<
+ UseCustomMutationOptions<
DeleteThirdPartyAuthIntegrationData,
ResponseError,
DeleteThirdPartyAuthIntegrationVariables
diff --git a/apps/studio/data/third-party-auth/integrations-query.ts b/apps/studio/data/third-party-auth/integrations-query.ts
index 04d7e4a3d11..20975a8fa66 100644
--- a/apps/studio/data/third-party-auth/integrations-query.ts
+++ b/apps/studio/data/third-party-auth/integrations-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { components } from 'api-types'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { keys } from './keys'
export type GetThirdPartyAuthIntegrationsVariables = {
@@ -34,7 +34,7 @@ export const useThirdPartyAuthIntegrationsQuery = <TData = ThirdPartyAuthIntegra
{
enabled = true,
...options
- }: UseQueryOptions<ThirdPartyAuthIntegrationsData, ResponseError, TData> = {}
+ }: UseCustomQueryOptions<ThirdPartyAuthIntegrationsData, ResponseError, TData> = {}
) =>
useQuery<ThirdPartyAuthIntegrationsData, ResponseError, TData>({
queryKey: keys.integrations(projectRef),
diff --git a/apps/studio/data/usage/org-usage-query.ts b/apps/studio/data/usage/org-usage-query.ts
index e8a9e7bdf4b..74c7138258a 100644
--- a/apps/studio/data/usage/org-usage-query.ts
+++ b/apps/studio/data/usage/org-usage-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
import { IS_PLATFORM } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { usageKeys } from './keys'
export type OrgUsageVariables = {
@@ -41,7 +41,7 @@ export type OrgUsageError = ResponseError
export const useOrgUsageQuery = <TData = OrgUsageData>(
{ orgSlug, projectRef, start, end }: OrgUsageVariables,
- { enabled = true, ...options }: UseQueryOptions<OrgUsageData, OrgUsageError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<OrgUsageData, OrgUsageError, TData> = {}
) =>
useQuery<OrgUsageData, OrgUsageError, TData>({
queryKey: usageKeys.orgUsage(
diff --git a/apps/studio/data/usage/resource-warnings-query.ts b/apps/studio/data/usage/resource-warnings-query.ts
index 8304d8d5ca4..fff37917a5c 100644
--- a/apps/studio/data/usage/resource-warnings-query.ts
+++ b/apps/studio/data/usage/resource-warnings-query.ts
@@ -1,9 +1,9 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { IS_PLATFORM } from 'common'
import type { components } from 'data/api'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { usageKeys } from './keys'
export type ResourceWarningsVariables = {
@@ -38,7 +38,7 @@ export const useResourceWarningsQuery = <TData = ResourceWarningsData>(
{
enabled = true,
...options
- }: UseQueryOptions<ResourceWarningsData, ResourceWarningsError, TData> = {}
+ }: UseCustomQueryOptions<ResourceWarningsData, ResourceWarningsError, TData> = {}
) =>
useQuery<ResourceWarningsData, ResourceWarningsError, TData>({
queryKey: usageKeys.resourceWarnings(variables.slug, variables.ref),
diff --git a/apps/studio/data/utils/deployment-commit-query.ts b/apps/studio/data/utils/deployment-commit-query.ts
index 775e2c417e4..f434268ac26 100644
--- a/apps/studio/data/utils/deployment-commit-query.ts
+++ b/apps/studio/data/utils/deployment-commit-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { fetchHandler } from 'data/fetchers'
import { BASE_PATH } from 'lib/constants'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
export async function getDeploymentCommit(signal?: AbortSignal) {
const response = await fetchHandler(`${BASE_PATH}/api/get-deployment-commit`)
@@ -13,7 +13,7 @@ export type DeploymentCommitData = Awaited<ReturnType<typeof getDeploymentCommit
export const useDeploymentCommitQuery = <TData = DeploymentCommitData>({
enabled = true,
...options
-}: UseQueryOptions<DeploymentCommitData, ResponseError, TData> = {}) =>
+}: UseCustomQueryOptions<DeploymentCommitData, ResponseError, TData> = {}) =>
useQuery<DeploymentCommitData, ResponseError, TData>({
queryKey: ['deployment-commit'],
queryFn: ({ signal }) => getDeploymentCommit(signal),
diff --git a/apps/studio/data/vault/vault-secret-create-mutation.ts b/apps/studio/data/vault/vault-secret-create-mutation.ts
index 62a5d96e37b..e70c8462ceb 100644
--- a/apps/studio/data/vault/vault-secret-create-mutation.ts
+++ b/apps/studio/data/vault/vault-secret-create-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
import { quoteLiteral } from 'lib/pg-format'
-import type { ResponseError, VaultSecret } from 'types'
+import type { ResponseError, UseCustomMutationOptions, VaultSecret } from 'types'
import { vaultSecretsKeys } from './keys'
export type VaultSecretCreateVariables = {
@@ -36,7 +36,7 @@ export const useVaultSecretCreateMutation = ({
onSuccess,
...options
}: Omit<
- UseMutationOptions<VaultSecretCreateData, ResponseError, VaultSecretCreateVariables>,
+ UseCustomMutationOptions<VaultSecretCreateData, ResponseError, VaultSecretCreateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/vault/vault-secret-decrypted-value-query.ts b/apps/studio/data/vault/vault-secret-decrypted-value-query.ts
index 4657fd2b31c..18e465b8945 100644
--- a/apps/studio/data/vault/vault-secret-decrypted-value-query.ts
+++ b/apps/studio/data/vault/vault-secret-decrypted-value-query.ts
@@ -1,7 +1,8 @@
import { Query } from '@supabase/pg-meta/src/query'
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { executeSql } from '../sql/execute-sql-query'
import { vaultSecretsKeys } from './keys'
+import { UseCustomQueryOptions } from 'types'
const vaultSecretDecryptedValueQuery = (id: string) => {
const sql = new Query()
@@ -55,7 +56,7 @@ export const useVaultSecretDecryptedValueQuery = <TData = string>(
{
enabled = true,
...options
- }: UseQueryOptions<getDecryptedValueResult, VaultSecretsDecryptedValueError, TData> = {}
+ }: UseCustomQueryOptions<getDecryptedValueResult, VaultSecretsDecryptedValueError, TData> = {}
) =>
useQuery<getDecryptedValueResult, VaultSecretsDecryptedValueError, TData>({
queryKey: vaultSecretsKeys.getDecryptedValue(projectRef, id),
diff --git a/apps/studio/data/vault/vault-secret-delete-mutation.ts b/apps/studio/data/vault/vault-secret-delete-mutation.ts
index 6ef380309b4..541243afa84 100644
--- a/apps/studio/data/vault/vault-secret-delete-mutation.ts
+++ b/apps/studio/data/vault/vault-secret-delete-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { Query } from '@supabase/pg-meta/src/query'
import { executeSql } from 'data/sql/execute-sql-query'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomMutationOptions } from 'types'
import { vaultSecretsKeys } from './keys'
export type VaultSecretDeleteVariables = {
@@ -29,7 +29,7 @@ export const useVaultSecretDeleteMutation = ({
onSuccess,
...options
}: Omit<
- UseMutationOptions<VaultSecretDeleteData, ResponseError, VaultSecretDeleteVariables>,
+ UseCustomMutationOptions<VaultSecretDeleteData, ResponseError, VaultSecretDeleteVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/vault/vault-secret-update-mutation.ts b/apps/studio/data/vault/vault-secret-update-mutation.ts
index 753aee03a8f..1619543e67a 100644
--- a/apps/studio/data/vault/vault-secret-update-mutation.ts
+++ b/apps/studio/data/vault/vault-secret-update-mutation.ts
@@ -1,9 +1,9 @@
-import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
+import { useMutation, useQueryClient } from '@tanstack/react-query'
import { toast } from 'sonner'
import { executeSql } from 'data/sql/execute-sql-query'
import { quoteLiteral } from 'lib/pg-format'
-import type { ResponseError, VaultSecret } from 'types'
+import type { ResponseError, UseCustomMutationOptions, VaultSecret } from 'types'
import { vaultSecretsKeys } from './keys'
export type VaultSecretUpdateVariables = {
@@ -39,7 +39,7 @@ export const useVaultSecretUpdateMutation = ({
onSuccess,
...options
}: Omit<
- UseMutationOptions<VaultSecretUpdateData, ResponseError, VaultSecretUpdateVariables>,
+ UseCustomMutationOptions<VaultSecretUpdateData, ResponseError, VaultSecretUpdateVariables>,
'mutationFn'
> = {}) => {
const queryClient = useQueryClient()
diff --git a/apps/studio/data/vault/vault-secrets-query.ts b/apps/studio/data/vault/vault-secrets-query.ts
index 93ae6537e55..30b4ac0f2e8 100644
--- a/apps/studio/data/vault/vault-secrets-query.ts
+++ b/apps/studio/data/vault/vault-secrets-query.ts
@@ -1,6 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
import { Query } from '@supabase/pg-meta/src/query'
-import type { VaultSecret } from 'types'
+import { useQuery } from '@tanstack/react-query'
+
+import type { UseCustomQueryOptions, VaultSecret } from 'types'
import { executeSql, ExecuteSqlError } from '../sql/execute-sql-query'
import { vaultSecretsKeys } from './keys'
@@ -37,7 +38,10 @@ export type VaultSecretsError = ExecuteSqlError
export const useVaultSecretsQuery = <TData = VaultSecretsData>(
{ projectRef, connectionString }: VaultSecretsVariables,
- { enabled = true, ...options }: UseQueryOptions<VaultSecretsData, VaultSecretsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<VaultSecretsData, VaultSecretsError, TData> = {}
) =>
useQuery<VaultSecretsData, VaultSecretsError, TData>({
queryKey: vaultSecretsKeys.list(projectRef),
diff --git a/apps/studio/data/views/views-query.ts b/apps/studio/data/views/views-query.ts
index e271aa74546..31d6621e4bf 100644
--- a/apps/studio/data/views/views-query.ts
+++ b/apps/studio/data/views/views-query.ts
@@ -1,10 +1,10 @@
-import { UseQueryOptions, useQuery } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
+import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
import { PostgresView } from '@supabase/postgres-meta'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { viewKeys } from './keys'
-import { DEFAULT_PLATFORM_APPLICATION_NAME } from '@supabase/pg-meta/src/constants'
export type ViewsVariables = {
projectRef?: string
@@ -45,7 +45,7 @@ export type ViewsError = ResponseError
export const useViewsQuery = <TData = ViewsData>(
{ projectRef, connectionString, schema }: ViewsVariables,
- { enabled = true, ...options }: UseQueryOptions<ViewsData, ViewsError, TData> = {}
+ { enabled = true, ...options }: UseCustomQueryOptions<ViewsData, ViewsError, TData> = {}
) =>
useQuery<ViewsData, ViewsError, TData>({
queryKey: schema ? viewKeys.listBySchema(projectRef, schema) : viewKeys.list(projectRef),
diff --git a/apps/studio/data/workflow-runs/workflow-run-logs-query.ts b/apps/studio/data/workflow-runs/workflow-run-logs-query.ts
index b2ee250781e..0cc924202b2 100644
--- a/apps/studio/data/workflow-runs/workflow-run-logs-query.ts
+++ b/apps/studio/data/workflow-runs/workflow-run-logs-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { workflowRunKeys } from './keys'
export type WorkflowRunLogsVariables = {
@@ -42,7 +42,7 @@ export const useWorkflowRunLogsQuery = <TData = WorkflowRunLogsData>(
{
enabled = true,
...options
- }: UseQueryOptions<WorkflowRunLogsData, WorkflowRunLogsError, TData> = {}
+ }: UseCustomQueryOptions<WorkflowRunLogsData, WorkflowRunLogsError, TData> = {}
) =>
useQuery<WorkflowRunLogsData, WorkflowRunLogsError, TData>({
queryKey: workflowRunKeys.list(workflowRunId),
diff --git a/apps/studio/data/workflow-runs/workflow-run-query.ts b/apps/studio/data/workflow-runs/workflow-run-query.ts
index 7b76abb693b..ccd30669785 100644
--- a/apps/studio/data/workflow-runs/workflow-run-query.ts
+++ b/apps/studio/data/workflow-runs/workflow-run-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { workflowRunKeys } from './keys'
export type WorkflowRunVariables = {
@@ -39,7 +39,10 @@ export type WorkflowRunError = ResponseError
export const useWorkflowRunQuery = <TData = WorkflowRunData>(
{ projectRef, workflowRunId }: WorkflowRunVariables,
- { enabled = true, ...options }: UseQueryOptions<WorkflowRunData, WorkflowRunError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<WorkflowRunData, WorkflowRunError, TData> = {}
) =>
useQuery<WorkflowRunData, WorkflowRunError, TData>({
queryKey: workflowRunKeys.detail(projectRef, workflowRunId),
diff --git a/apps/studio/data/workflow-runs/workflow-runs-query.ts b/apps/studio/data/workflow-runs/workflow-runs-query.ts
index c907eef42ab..5b36f3679d6 100644
--- a/apps/studio/data/workflow-runs/workflow-runs-query.ts
+++ b/apps/studio/data/workflow-runs/workflow-runs-query.ts
@@ -1,7 +1,7 @@
-import { useQuery, UseQueryOptions } from '@tanstack/react-query'
+import { useQuery } from '@tanstack/react-query'
import { get, handleError } from 'data/fetchers'
-import type { ResponseError } from 'types'
+import type { ResponseError, UseCustomQueryOptions } from 'types'
import { workflowRunKeys } from './keys'
export type WorkflowRunsVariables = {
@@ -28,7 +28,10 @@ export type WorkflowRunsError = ResponseError
export const useWorkflowRunsQuery = <TData = WorkflowRunsData>(
{ projectRef }: WorkflowRunsVariables,
- { enabled = true, ...options }: UseQueryOptions<WorkflowRunsData, WorkflowRunsError, TData> = {}
+ {
+ enabled = true,
+ ...options
+ }: UseCustomQueryOptions<WorkflowRunsData, WorkflowRunsError, TData> = {}
) =>
useQuery<WorkflowRunsData, WorkflowRunsError, TData>({
queryKey: workflowRunKeys.list(projectRef),
diff --git a/apps/studio/types/base.ts b/apps/studio/types/base.ts
index 1c477202c4c..81f5a5aff08 100644
--- a/apps/studio/types/base.ts
+++ b/apps/studio/types/base.ts
@@ -1,8 +1,8 @@
-import { PermissionAction } from '@supabase/shared-types/out/constants'
-import { OrganizationBase } from 'data/organizations/organizations-query'
-import { PlanId } from 'data/subscriptions/types'
-import jsonLogic from 'json-logic-js'
-import { ManagedBy } from 'lib/constants/infrastructure'
+import type { PermissionAction } from '@supabase/shared-types/out/constants'
+import type { OrganizationBase } from 'data/organizations/organizations-query'
+import type { PlanId } from 'data/subscriptions/types'
+import type jsonLogic from 'json-logic-js'
+import type { ManagedBy } from 'lib/constants/infrastructure'
export interface Organization extends OrganizationBase {
managed_by: ManagedBy
diff --git a/apps/studio/types/index.ts b/apps/studio/types/index.ts
index e53ca46b6e0..5fe47deabdb 100644
--- a/apps/studio/types/index.ts
+++ b/apps/studio/types/index.ts
@@ -10,5 +10,6 @@ export {
export type * from './form'
export type * from './next'
export { isNextPageWithLayout } from './next'
+export type * from './react-query'
export type * from './ui'
export type * from './userContent'
diff --git a/apps/studio/types/react-query.ts b/apps/studio/types/react-query.ts
new file mode 100644
index 00000000000..bbee81fc593
--- /dev/null
+++ b/apps/studio/types/react-query.ts
@@ -0,0 +1,28 @@
+import type {
+ QueryKey,
+ UseInfiniteQueryOptions,
+ UseMutationOptions,
+ UseQueryOptions,
+} from '@tanstack/react-query'
+
+export type UseCustomQueryOptions<
+ TQueryFnData = unknown,
+ TError = unknown,
+ TData = TQueryFnData,
+ TQueryKey extends QueryKey = QueryKey,
+> = UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>
+
+export type UseCustomMutationOptions<
+ TData = unknown,
+ TError = unknown,
+ TVariables = void,
+ TContext = unknown,
+> = UseMutationOptions<TData, TError, TVariables, TContext>
+
+export type UseCustomInfiniteQueryOptions<
+ TQueryFnData = unknown,
+ TError = unknown,
+ TData = TQueryFnData,
+ TQueryData = TQueryFnData,
+ TQueryKey extends QueryKey = QueryKey,
+> = UseInfiniteQueryOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>