/**
 * Per-API feature flag overrides; NULL columns inherit from database_settings, explicit true/false overrides the database default
 * @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 { apiSettingKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const apiSettingQueryKey = apiSettingKeys.detail;
export function useApiSettingQuery(params) {
    const args = buildSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: apiSettingKeys.detail(params.id),
        queryFn: () => getClient()
            .apiSetting.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
        ...queryOptions,
    });
}
export async function fetchApiSettingQuery(params) {
    const args = buildSelectionArgs(params.selection);
    return getClient()
        .apiSetting.findOne({
        id: params.id,
        select: args.select,
    })
        .unwrap();
}
export async function prefetchApiSettingQuery(queryClient, params) {
    const args = buildSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: apiSettingKeys.detail(params.id),
        queryFn: () => getClient()
            .apiSetting.findOne({
            id: params.id,
            select: args.select,
        })
            .unwrap(),
    });
}
