/**
 * Branded catalog of external service integrations and their canonical secret/config requirements. Each row defines a provider (e.g. Mailgun, Postgres) that function and resource definitions can reference by slug. The required_secrets/required_configs arrays are guidance that the UI can copy into a definition; the definition arrays remain the source of truth.
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildListSelectionArgs } from '../selection';
import { integrationProviderKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const integrationProvidersQueryKey = integrationProviderKeys.list;
export function useIntegrationProvidersQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: integrationProviderKeys.list(args),
        queryFn: () => getClient().integrationProvider.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchIntegrationProvidersQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().integrationProvider.findMany(args).unwrap();
}
export async function prefetchIntegrationProvidersQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: integrationProviderKeys.list(args),
        queryFn: () => getClient().integrationProvider.findMany(args).unwrap(),
    });
}
