/** * PlatformRepositoryEvent 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 { PlatformRepositoryEvent, PlatformRepositoryEventWithRelations, PlatformRepositoryEventSelect, PlatformRepositoryEventFilter, PlatformRepositoryEventOrderBy, CreatePlatformRepositoryEventInput, UpdatePlatformRepositoryEventInput, PlatformRepositoryEventPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformRepositoryEventModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformRepositoryEvents: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformRepositoryEvent', 'platformRepositoryEvents', 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, }, 'PlatformRepositoryEventFilter', 'PlatformRepositoryEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformRepositoryEvent', fieldName: 'platformRepositoryEvents', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformRepositoryEvent: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformRepositoryEvent', 'platformRepositoryEvents', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformRepositoryEventFilter', 'PlatformRepositoryEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformRepositoryEvent', fieldName: 'platformRepositoryEvent', document, variables, transform: (data: { platformRepositoryEvents?: { nodes?: InferSelectResult[]; }; }) => ({ platformRepositoryEvent: data.platformRepositoryEvents?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformRepositoryEvent: InferSelectResult | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformRepositoryEvent', 'platformRepositoryEvents', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformRepositoryEventFilter', 'PlatformRepositoryEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformRepositoryEvent', fieldName: 'platformRepositoryEvent', document, variables, transform: (data: { platformRepositoryEvents?: { nodes?: InferSelectResult[]; }; }) => ({ platformRepositoryEvent: data.platformRepositoryEvents?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformRepositoryEvent: { platformRepositoryEvent: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformRepositoryEvent', 'createPlatformRepositoryEvent', 'platformRepositoryEvent', args.select, args.data, 'CreatePlatformRepositoryEventInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformRepositoryEvent', fieldName: 'createPlatformRepositoryEvent', document, variables, }); } update( args: UpdateArgs< S, { id: string; }, PlatformRepositoryEventPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformRepositoryEvent: { platformRepositoryEvent: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformRepositoryEvent', 'updatePlatformRepositoryEvent', 'platformRepositoryEvent', args.select, args.where.id, args.data, 'UpdatePlatformRepositoryEventInput', 'id', 'platformRepositoryEventPatch', connectionFieldsMap, undefined ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformRepositoryEvent', fieldName: 'updatePlatformRepositoryEvent', document, variables, }); } delete( args: DeleteArgs< { id: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformRepositoryEvent: { platformRepositoryEvent: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformRepositoryEvent', 'deletePlatformRepositoryEvent', 'platformRepositoryEvent', { id: args.where.id, }, 'DeletePlatformRepositoryEventInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformRepositoryEvent', fieldName: 'deletePlatformRepositoryEvent', document, variables, }); } }