/**
 * Mobile and native app configuration linked to a site, including store links and identifiers
 * @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 { appKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const appsQueryKey = appKeys.list;
export function useAppsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: appKeys.list(args),
        queryFn: () => getClient().app.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchAppsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().app.findMany(args).unwrap();
}
export async function prefetchAppsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: appKeys.list(args),
        queryFn: () => getClient().app.findMany(args).unwrap(),
    });
}
