/**
 * Single item query hook for I18NModule
 * @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 { i18NModuleKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const i18NModuleQueryKey = i18NModuleKeys.detail;
export function useI18NModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: i18NModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .i18NModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchI18NModuleQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .i18NModule.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchI18NModuleQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: i18NModuleKeys.detail(params.id),
        queryFn: () => getClient()
            .i18NModule.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
