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