/**
 * Join table linking APIs to the database schemas they expose; controls which schemas are accessible through each API
 * @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 { apiSchemaKeys } from '../query-keys';
/** Query key factory - re-exported from query-keys.ts */
export const apiSchemasQueryKey = apiSchemaKeys.list;
export function useApiSchemasQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    const { selection: _selection, ...queryOptions } = params ?? {};
    void _selection;
    return useQuery({
        queryKey: apiSchemaKeys.list(args),
        queryFn: () => getClient().apiSchema.findMany(args).unwrap(),
        ...queryOptions,
    });
}
export async function fetchApiSchemasQuery(params) {
    const args = buildListSelectionArgs(params.selection);
    return getClient().apiSchema.findMany(args).unwrap();
}
export async function prefetchApiSchemasQuery(queryClient, params) {
    const args = buildListSelectionArgs(params.selection);
    await queryClient.prefetchQuery({
        queryKey: apiSchemaKeys.list(args),
        queryFn: () => getClient().apiSchema.findMany(args).unwrap(),
    });
}
