/**
 * Per-scope permission overrides for principals. No row = full access; row exists = apply restrictions.
 * @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 { principalScopeOverrideKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const principalScopeOverridesQueryKey = principalScopeOverrideKeys.list;
export function usePrincipalScopeOverridesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: principalScopeOverrideKeys.list(args),
        queryFn: () => getClient().principalScopeOverride.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPrincipalScopeOverridesQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().principalScopeOverride.findMany(args).unwrap();
}
export async function prefetchPrincipalScopeOverridesQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: principalScopeOverrideKeys.list(args),
        queryFn: () => getClient().principalScopeOverride.findMany(args).unwrap(),
    });
}
