/**
 * Tracks individual construction attempts of a blueprint. Each time construct_blueprint() is called, a new record is created here. This separates the editable blueprint definition from its build history, allowing blueprints to be re-executed, constructed into multiple databases, and maintain an audit trail of all construction attempts.
 * @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 { blueprintConstructionKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const blueprintConstructionsQueryKey = blueprintConstructionKeys.list;
export function useBlueprintConstructionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: blueprintConstructionKeys.list(args),
        queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchBlueprintConstructionsQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().blueprintConstruction.findMany(args).unwrap();
}
export async function prefetchBlueprintConstructionsQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: blueprintConstructionKeys.list(args),
        queryFn: () => getClient().blueprintConstruction.findMany(args).unwrap(),
    });
}
