/** * FunctionGraphExecution model for ORM client * @generated by @constructive-io/graphql-codegen * DO NOT EDIT - changes will be overwritten */ import { OrmClient } from '../client'; import { QueryBuilder, buildFindManyDocument, buildFindFirstDocument, buildFindOneDocument, buildCreateDocument, buildUpdateByPkDocument, buildDeleteByPkDocument, } from '../query-builder'; import type { ConnectionResult, FindManyArgs, FindFirstArgs, CreateArgs, UpdateArgs, DeleteArgs, InferSelectResult, StrictSelect, } from '../select-types'; import type { FunctionGraphExecution, FunctionGraphExecutionWithRelations, FunctionGraphExecutionSelect, FunctionGraphExecutionFilter, FunctionGraphExecutionOrderBy, CreateFunctionGraphExecutionInput, UpdateFunctionGraphExecutionInput, FunctionGraphExecutionPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class FunctionGraphExecutionModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ functionGraphExecutions: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'FunctionGraphExecution', 'functionGraphExecutions', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, first: args?.first, last: args?.last, after: args?.after, before: args?.before, offset: args?.offset, }, 'FunctionGraphExecutionFilter', 'FunctionGraphExecutionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'FunctionGraphExecution', fieldName: 'functionGraphExecutions', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'FunctionGraphExecution', 'functionGraphExecutions', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'FunctionGraphExecutionFilter', 'FunctionGraphExecutionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'FunctionGraphExecution', fieldName: 'functionGraphExecution', document, variables, transform: (data: { functionGraphExecutions?: { nodes?: InferSelectResult[]; }; }) => ({ functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ functionGraphExecution: InferSelectResult | null; }> { const { document, variables } = buildFindManyDocument( 'FunctionGraphExecution', 'functionGraphExecutions', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'FunctionGraphExecutionFilter', 'FunctionGraphExecutionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'FunctionGraphExecution', fieldName: 'functionGraphExecution', document, variables, transform: (data: { functionGraphExecutions?: { nodes?: InferSelectResult[]; }; }) => ({ functionGraphExecution: data.functionGraphExecutions?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'FunctionGraphExecution', 'createFunctionGraphExecution', 'functionGraphExecution', args.select, args.data, 'CreateFunctionGraphExecutionInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'FunctionGraphExecution', fieldName: 'createFunctionGraphExecution', document, variables, }); } update( args: UpdateArgs< S, { id: string; startedAt: string; }, FunctionGraphExecutionPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updateFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'FunctionGraphExecution', 'updateFunctionGraphExecution', 'functionGraphExecution', args.select, args.where.id, args.data, 'UpdateFunctionGraphExecutionInput', 'id', 'functionGraphExecutionPatch', connectionFieldsMap, { startedAt: args.where.startedAt, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'FunctionGraphExecution', fieldName: 'updateFunctionGraphExecution', document, variables, }); } delete( args: DeleteArgs< { id: string; startedAt: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deleteFunctionGraphExecution: { functionGraphExecution: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'FunctionGraphExecution', 'deleteFunctionGraphExecution', 'functionGraphExecution', { id: args.where.id, startedAt: args.where.startedAt, }, 'DeleteFunctionGraphExecutionInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'FunctionGraphExecution', fieldName: 'deleteFunctionGraphExecution', document, variables, }); } }