/**
 * Installed resource bundle ("release") — groups a set of resources; params are merkle-versioned in the scope's shared infra store for rollback
 * @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 { platformResourceInstallationKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const platformResourceInstallationsQueryKey = platformResourceInstallationKeys.list;
export function usePlatformResourceInstallationsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: platformResourceInstallationKeys.list(args),
        queryFn: () => getClient().platformResourceInstallation.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchPlatformResourceInstallationsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().platformResourceInstallation.findMany(args).unwrap();
}
export async function prefetchPlatformResourceInstallationsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: platformResourceInstallationKeys.list(args),
        queryFn: () => getClient().platformResourceInstallation.findMany(args).unwrap(),
    });
}
