/**
 * List query hook for ForeignKeyConstraint
 * @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 { foreignKeyConstraintKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const foreignKeyConstraintsQueryKey = foreignKeyConstraintKeys.list;
export function useForeignKeyConstraintsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: foreignKeyConstraintKeys.list(args),
        queryFn: () => getClient().foreignKeyConstraint.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchForeignKeyConstraintsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().foreignKeyConstraint.findMany(args).unwrap();
}
export async function prefetchForeignKeyConstraintsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: foreignKeyConstraintKeys.list(args),
        queryFn: () => getClient().foreignKeyConstraint.findMany(args).unwrap(),
    });
}
