/** * PlatformFunctionInvocationAttempt 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 { PlatformFunctionInvocationAttempt, PlatformFunctionInvocationAttemptWithRelations, PlatformFunctionInvocationAttemptSelect, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy, CreatePlatformFunctionInvocationAttemptInput, UpdatePlatformFunctionInvocationAttemptInput, PlatformFunctionInvocationAttemptPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationAttemptModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs< S, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocationAttempts: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempts', 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, }, 'PlatformFunctionInvocationAttemptFilter', 'PlatformFunctionInvocationAttemptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'platformFunctionInvocationAttempts', document, variables, }); } findFirst( args: FindFirstArgs< S, PlatformFunctionInvocationAttemptFilter, PlatformFunctionInvocationAttemptOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocationAttempt: InferSelectResult< PlatformFunctionInvocationAttemptWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempts', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionInvocationAttemptFilter', 'PlatformFunctionInvocationAttemptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { platformFunctionInvocationAttempts?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionInvocationAttempt: data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocationAttempt: InferSelectResult< PlatformFunctionInvocationAttemptWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempts', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionInvocationAttemptFilter', 'PlatformFunctionInvocationAttemptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'platformFunctionInvocationAttempt', document, variables, transform: (data: { platformFunctionInvocationAttempts?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionInvocationAttempt: data.platformFunctionInvocationAttempts?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs< S, CreatePlatformFunctionInvocationAttemptInput['platformFunctionInvocationAttempt'] > & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionInvocationAttempt: { platformFunctionInvocationAttempt: InferSelectResult< PlatformFunctionInvocationAttemptWithRelations, S >; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionInvocationAttempt', 'createPlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempt', args.select, args.data, 'CreatePlatformFunctionInvocationAttemptInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'createPlatformFunctionInvocationAttempt', document, variables, }); } update( args: UpdateArgs< S, { id: string; createdAt: string; }, PlatformFunctionInvocationAttemptPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionInvocationAttempt: { platformFunctionInvocationAttempt: InferSelectResult< PlatformFunctionInvocationAttemptWithRelations, S >; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionInvocationAttempt', 'updatePlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempt', args.select, args.where.id, args.data, 'UpdatePlatformFunctionInvocationAttemptInput', 'id', 'platformFunctionInvocationAttemptPatch', connectionFieldsMap, { createdAt: args.where.createdAt, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'updatePlatformFunctionInvocationAttempt', document, variables, }); } delete( args: DeleteArgs< { id: string; createdAt: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionInvocationAttempt: { platformFunctionInvocationAttempt: InferSelectResult< PlatformFunctionInvocationAttemptWithRelations, S >; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionInvocationAttempt', 'deletePlatformFunctionInvocationAttempt', 'platformFunctionInvocationAttempt', { id: args.where.id, createdAt: args.where.createdAt, }, 'DeletePlatformFunctionInvocationAttemptInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocationAttempt', fieldName: 'deletePlatformFunctionInvocationAttempt', document, variables, }); } }