/**
 * Provisions security, fields, grants, and policies onto a table. Each row can independently: (1) create fields via nodes[] array (supporting multiple Data* modules per row), (2) grant privileges via grants[] array (supporting per-role privilege targeting), (3) create RLS policies via policies[] array (supporting multiple Authz* policies per row). Multiple rows can target the same table to compose different concerns. All three concerns are optional and independent.
 * @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 { secureTableProvisionKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const secureTableProvisionsQueryKey = secureTableProvisionKeys.list;
export function useSecureTableProvisionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: secureTableProvisionKeys.list(args),
        queryFn: () => getClient().secureTableProvision.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchSecureTableProvisionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().secureTableProvision.findMany(args).unwrap();
}
export async function prefetchSecureTableProvisionsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: secureTableProvisionKeys.list(args),
        queryFn: () => getClient().secureTableProvision.findMany(args).unwrap(),
    });
}
