/**
 * Single item query hook for DbPresetModule
 * @generated by @constructive-io/graphql-codegen
 * DO NOT EDIT - changes will be overwritten
 */
import { useQuery } from '@tanstack/react-query';
import { getClient } from '../client';
import { buildSelectionArgs } from '../selection';
import { dbPresetModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const dbPresetModuleQueryKey = dbPresetModuleKeys.detail;
export function useDbPresetModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: dbPresetModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .dbPresetModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchDbPresetModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .dbPresetModule.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchDbPresetModuleQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: dbPresetModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .dbPresetModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
