/** * PlatformFunctionExecutionLog 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 { PlatformFunctionExecutionLog, PlatformFunctionExecutionLogWithRelations, PlatformFunctionExecutionLogSelect, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy, CreatePlatformFunctionExecutionLogInput, UpdatePlatformFunctionExecutionLogInput, PlatformFunctionExecutionLogPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionExecutionLogModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs< S, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionExecutionLogs: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', 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, }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionExecutionLog', fieldName: 'platformFunctionExecutionLogs', document, variables, }); } findFirst( args: FindFirstArgs< S, PlatformFunctionExecutionLogFilter, PlatformFunctionExecutionLogOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionExecutionLog: InferSelectResult< PlatformFunctionExecutionLogWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionExecutionLog', fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { platformFunctionExecutionLogs?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionExecutionLog: InferSelectResult< PlatformFunctionExecutionLogWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionExecutionLog', 'platformFunctionExecutionLogs', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionExecutionLogFilter', 'PlatformFunctionExecutionLogOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionExecutionLog', fieldName: 'platformFunctionExecutionLog', document, variables, transform: (data: { platformFunctionExecutionLogs?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionExecutionLog: data.platformFunctionExecutionLogs?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionExecutionLog', 'createPlatformFunctionExecutionLog', 'platformFunctionExecutionLog', args.select, args.data, 'CreatePlatformFunctionExecutionLogInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionExecutionLog', fieldName: 'createPlatformFunctionExecutionLog', document, variables, }); } update( args: UpdateArgs< S, { id: string; createdAt: string; }, PlatformFunctionExecutionLogPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionExecutionLog', 'updatePlatformFunctionExecutionLog', 'platformFunctionExecutionLog', args.select, args.where.id, args.data, 'UpdatePlatformFunctionExecutionLogInput', 'id', 'platformFunctionExecutionLogPatch', connectionFieldsMap, { createdAt: args.where.createdAt, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionExecutionLog', fieldName: 'updatePlatformFunctionExecutionLog', document, variables, }); } delete( args: DeleteArgs< { id: string; createdAt: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionExecutionLog: { platformFunctionExecutionLog: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionExecutionLog', 'deletePlatformFunctionExecutionLog', 'platformFunctionExecutionLog', { id: args.where.id, createdAt: args.where.createdAt, }, 'DeletePlatformFunctionExecutionLogInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionExecutionLog', fieldName: 'deletePlatformFunctionExecutionLog', document, variables, }); } }