/**
 * List query hook for PermissionsModule
 * @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 { permissionsModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const permissionsModulesQueryKey = permissionsModuleKeys.list;
export function usePermissionsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: permissionsModuleKeys.list(args),
        queryFn: () => getClient().permissionsModule.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPermissionsModulesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().permissionsModule.findMany(args).unwrap();
}
export async function prefetchPermissionsModulesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: permissionsModuleKeys.list(args),
        queryFn: () => getClient().permissionsModule.findMany(args).unwrap(),
    });
}
