/**
 * Config row for the integration_providers_module, which provisions a per-database
     integration_providers table holding branded, reusable service definitions.
     Integration providers act as a catalog of external services (e.g. Mailgun, Postgres)
     and list the canonical secret/config names required to use them.
     Other modules (function_module, resource_module) match the provider slug as a string.
 * @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 { integrationProvidersModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const integrationProvidersModulesQueryKey = integrationProvidersModuleKeys.list;
export function useIntegrationProvidersModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: integrationProvidersModuleKeys.list(args),
        queryFn: () => getClient().integrationProvidersModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchIntegrationProvidersModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().integrationProvidersModule.findMany(args).unwrap();
}
export async function prefetchIntegrationProvidersModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: integrationProvidersModuleKeys.list(args),
        queryFn: () => getClient().integrationProvidersModule.findMany(args).unwrap(),
    });
}
