/** * Per-node execution state — tracks individual node lifecycle for debugging * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ import { useQuery } from '@tanstack/react-query'; import type { UseQueryOptions, UseQueryResult, QueryClient } from '@tanstack/react-query'; import { getClient } from '../client'; import { buildListSelectionArgs } from '../selection'; import type { ListSelectionConfig } from '../selection'; import { functionGraphExecutionNodeStateKeys } from '../query-keys'; import type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy, } from '../../orm/input-types'; import type { FindManyArgs, InferSelectResult, ConnectionResult, HookStrictSelect, } from '../../orm/select-types'; export type { FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateWithRelations, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy, } from '../../orm/input-types'; /** Query key factory - re-exported from query-keys.ts */ export const functionGraphExecutionNodeStatesQueryKey = functionGraphExecutionNodeStateKeys.list; /** * Per-node execution state — tracks individual node lifecycle for debugging * * @example * ```tsx * const { data, isLoading } = useFunctionGraphExecutionNodeStatesQuery({ * selection: { * fields: { id: true, name: true }, * where: { name: { equalTo: "example" } }, * orderBy: ['CREATED_AT_DESC'], * first: 10, * }, * }); * ``` */ export function useFunctionGraphExecutionNodeStatesQuery< S extends FunctionGraphExecutionNodeStateSelect, TData = { functionGraphExecutionNodeStates: ConnectionResult< InferSelectResult >; }, >( params: { selection: { fields: S; } & Omit< ListSelectionConfig< S, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >, 'fields' > & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; } & Omit< UseQueryOptions< { functionGraphExecutionNodeStates: ConnectionResult< InferSelectResult >; }, Error, TData >, 'queryKey' | 'queryFn' > ): UseQueryResult; export function useFunctionGraphExecutionNodeStatesQuery( params: { selection: ListSelectionConfig< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >; } & Omit, 'queryKey' | 'queryFn'> ) { const args = buildListSelectionArgs< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >(params.selection); const { selection: _selection, ...queryOptions } = params ?? {}; void _selection; return useQuery({ queryKey: functionGraphExecutionNodeStateKeys.list(args), queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), ...queryOptions, }); } /** * Per-node execution state — tracks individual node lifecycle for debugging * * @example * ```ts * const data = await fetchFunctionGraphExecutionNodeStatesQuery({ * selection: { * fields: { id: true }, * first: 10, * }, * }); * ``` */ export async function fetchFunctionGraphExecutionNodeStatesQuery< S extends FunctionGraphExecutionNodeStateSelect, >(params: { selection: { fields: S; } & Omit< ListSelectionConfig< S, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >, 'fields' > & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; }): Promise<{ functionGraphExecutionNodeStates: ConnectionResult< InferSelectResult >; }>; export async function fetchFunctionGraphExecutionNodeStatesQuery(params: { selection: ListSelectionConfig< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >; }) { const args = buildListSelectionArgs< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >(params.selection); return getClient().functionGraphExecutionNodeState.findMany(args).unwrap(); } /** * Per-node execution state — tracks individual node lifecycle for debugging * * @example * ```ts * await prefetchFunctionGraphExecutionNodeStatesQuery(queryClient, { selection: { fields: { id: true }, first: 10 } }); * ``` */ export async function prefetchFunctionGraphExecutionNodeStatesQuery< S extends FunctionGraphExecutionNodeStateSelect, >( queryClient: QueryClient, params: { selection: { fields: S; } & Omit< ListSelectionConfig< S, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >, 'fields' > & HookStrictSelect, FunctionGraphExecutionNodeStateSelect>; } ): Promise; export async function prefetchFunctionGraphExecutionNodeStatesQuery( queryClient: QueryClient, params: { selection: ListSelectionConfig< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >; } ): Promise { const args = buildListSelectionArgs< FunctionGraphExecutionNodeStateSelect, FunctionGraphExecutionNodeStateFilter, FunctionGraphExecutionNodeStateOrderBy >(params.selection); await queryClient.prefetchQuery({ queryKey: functionGraphExecutionNodeStateKeys.list(args), queryFn: () => getClient().functionGraphExecutionNodeState.findMany(args).unwrap(), }); }