/** * PlatformInfraObject 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 { PlatformInfraObject, PlatformInfraObjectWithRelations, PlatformInfraObjectSelect, PlatformInfraObjectFilter, PlatformInfraObjectOrderBy, CreatePlatformInfraObjectInput, UpdatePlatformInfraObjectInput, PlatformInfraObjectPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformInfraObjectModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformInfraObjects: ConnectionResult>; }> { const { document, variables } = buildFindManyDocument( 'PlatformInfraObject', 'platformInfraObjects', 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, }, 'PlatformInfraObjectFilter', 'PlatformInfraObjectOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformInfraObject', fieldName: 'platformInfraObjects', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformInfraObject', 'platformInfraObjects', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformInfraObjectFilter', 'PlatformInfraObjectOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformInfraObject', fieldName: 'platformInfraObject', document, variables, transform: (data: { platformInfraObjects?: { nodes?: InferSelectResult[]; }; }) => ({ platformInfraObject: data.platformInfraObjects?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformInfraObject: InferSelectResult | null; }> { const { document, variables } = buildFindOneDocument( 'PlatformInfraObject', 'platformInfraGetNodeAtPath', args.id, args.select, 'id', 'UUID!', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformInfraObject', fieldName: 'platformInfraObject', document, variables, }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformInfraObject', 'createPlatformInfraObject', 'platformInfraObject', args.select, args.data, 'CreatePlatformInfraObjectInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformInfraObject', fieldName: 'createPlatformInfraObject', document, variables, }); } update( args: UpdateArgs< S, { id: string; scopeId: string; }, PlatformInfraObjectPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformInfraObject', 'updatePlatformInfraObject', 'platformInfraObject', args.select, args.where.id, args.data, 'UpdatePlatformInfraObjectInput', 'id', 'platformInfraObjectPatch', connectionFieldsMap, { scopeId: args.where.scopeId, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformInfraObject', fieldName: 'updatePlatformInfraObject', document, variables, }); } delete( args: DeleteArgs< { id: string; scopeId: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformInfraObject: { platformInfraObject: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformInfraObject', 'deletePlatformInfraObject', 'platformInfraObject', { id: args.where.id, scopeId: args.where.scopeId, }, 'DeletePlatformInfraObjectInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformInfraObject', fieldName: 'deletePlatformInfraObject', document, variables, }); } }