/** * PlatformResourceDeclaredCapacity 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 { PlatformResourceDeclaredCapacity, PlatformResourceDeclaredCapacityWithRelations, PlatformResourceDeclaredCapacitySelect, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy, UpdatePlatformResourceDeclaredCapacityInput, PlatformResourceDeclaredCapacityPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs< S, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformResourceDeclaredCapacities: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformResourceDeclaredCapacity', 'platformResourceDeclaredCapacities', 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, }, 'PlatformResourceDeclaredCapacityFilter', 'PlatformResourceDeclaredCapacityOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformResourceDeclaredCapacity', fieldName: 'platformResourceDeclaredCapacities', document, variables, }); } findFirst( args: FindFirstArgs< S, PlatformResourceDeclaredCapacityFilter, PlatformResourceDeclaredCapacityOrderBy > & { select: S; } & StrictSelect ): QueryBuilder<{ platformResourceDeclaredCapacity: InferSelectResult< PlatformResourceDeclaredCapacityWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformResourceDeclaredCapacity', 'platformResourceDeclaredCapacities', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformResourceDeclaredCapacityFilter', 'PlatformResourceDeclaredCapacityOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformResourceDeclaredCapacity', fieldName: 'platformResourceDeclaredCapacity', document, variables, transform: (data: { platformResourceDeclaredCapacities?: { nodes?: InferSelectResult[]; }; }) => ({ platformResourceDeclaredCapacity: data.platformResourceDeclaredCapacities?.nodes?.[0] ?? null, }), }); } }