/** * PlatformFunctionDeploymentEvent 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 { PlatformFunctionDeploymentEvent, PlatformFunctionDeploymentEventWithRelations, PlatformFunctionDeploymentEventSelect, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy, CreatePlatformFunctionDeploymentEventInput, UpdatePlatformFunctionDeploymentEventInput, PlatformFunctionDeploymentEventPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentEventModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs< S, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeploymentEvents: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvents', 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, }, 'PlatformFunctionDeploymentEventFilter', 'PlatformFunctionDeploymentEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'platformFunctionDeploymentEvents', document, variables, }); } findFirst( args: FindFirstArgs< S, PlatformFunctionDeploymentEventFilter, PlatformFunctionDeploymentEventOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeploymentEvent: InferSelectResult< PlatformFunctionDeploymentEventWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvents', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionDeploymentEventFilter', 'PlatformFunctionDeploymentEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { platformFunctionDeploymentEvents?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeploymentEvent: InferSelectResult< PlatformFunctionDeploymentEventWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvents', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionDeploymentEventFilter', 'PlatformFunctionDeploymentEventOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'platformFunctionDeploymentEvent', document, variables, transform: (data: { platformFunctionDeploymentEvents?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDeploymentEvent: data.platformFunctionDeploymentEvents?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs< S, CreatePlatformFunctionDeploymentEventInput['platformFunctionDeploymentEvent'] > & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionDeploymentEvent: { platformFunctionDeploymentEvent: InferSelectResult< PlatformFunctionDeploymentEventWithRelations, S >; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionDeploymentEvent', 'createPlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvent', args.select, args.data, 'CreatePlatformFunctionDeploymentEventInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'createPlatformFunctionDeploymentEvent', document, variables, }); } update( args: UpdateArgs< S, { id: string; createdAt: string; }, PlatformFunctionDeploymentEventPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionDeploymentEvent: { platformFunctionDeploymentEvent: InferSelectResult< PlatformFunctionDeploymentEventWithRelations, S >; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionDeploymentEvent', 'updatePlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvent', args.select, args.where.id, args.data, 'UpdatePlatformFunctionDeploymentEventInput', 'id', 'platformFunctionDeploymentEventPatch', connectionFieldsMap, { createdAt: args.where.createdAt, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'updatePlatformFunctionDeploymentEvent', document, variables, }); } delete( args: DeleteArgs< { id: string; createdAt: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionDeploymentEvent: { platformFunctionDeploymentEvent: InferSelectResult< PlatformFunctionDeploymentEventWithRelations, S >; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionDeploymentEvent', 'deletePlatformFunctionDeploymentEvent', 'platformFunctionDeploymentEvent', { id: args.where.id, createdAt: args.where.createdAt, }, 'DeletePlatformFunctionDeploymentEventInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeploymentEvent', fieldName: 'deletePlatformFunctionDeploymentEvent', document, variables, }); } }