/** * PlatformFunctionDeployment 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 { PlatformFunctionDeployment, PlatformFunctionDeploymentWithRelations, PlatformFunctionDeploymentSelect, PlatformFunctionDeploymentFilter, PlatformFunctionDeploymentOrderBy, CreatePlatformFunctionDeploymentInput, UpdatePlatformFunctionDeploymentInput, PlatformFunctionDeploymentPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDeploymentModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeployments: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDeployment', 'platformFunctionDeployments', 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, }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeployment', fieldName: 'platformFunctionDeployments', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeployment: InferSelectResult< PlatformFunctionDeploymentWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionDeployment', 'platformFunctionDeployments', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeployment', fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { platformFunctionDeployments?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDeployment: InferSelectResult< PlatformFunctionDeploymentWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDeployment', 'platformFunctionDeployments', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionDeploymentFilter', 'PlatformFunctionDeploymentOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDeployment', fieldName: 'platformFunctionDeployment', document, variables, transform: (data: { platformFunctionDeployments?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDeployment: data.platformFunctionDeployments?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionDeployment', 'createPlatformFunctionDeployment', 'platformFunctionDeployment', args.select, args.data, 'CreatePlatformFunctionDeploymentInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeployment', fieldName: 'createPlatformFunctionDeployment', document, variables, }); } update( args: UpdateArgs< S, { id: string; }, PlatformFunctionDeploymentPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionDeployment', 'updatePlatformFunctionDeployment', 'platformFunctionDeployment', args.select, args.where.id, args.data, 'UpdatePlatformFunctionDeploymentInput', 'id', 'platformFunctionDeploymentPatch', connectionFieldsMap, undefined ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeployment', fieldName: 'updatePlatformFunctionDeployment', document, variables, }); } delete( args: DeleteArgs< { id: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionDeployment: { platformFunctionDeployment: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionDeployment', 'deletePlatformFunctionDeployment', 'platformFunctionDeployment', { id: args.where.id, }, 'DeletePlatformFunctionDeploymentInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDeployment', fieldName: 'deletePlatformFunctionDeployment', document, variables, }); } }