/** * ResourceDeclaredCapacity 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 { ResourceDeclaredCapacity, ResourceDeclaredCapacityWithRelations, ResourceDeclaredCapacitySelect, ResourceDeclaredCapacityFilter, ResourceDeclaredCapacityOrderBy, UpdateResourceDeclaredCapacityInput, ResourceDeclaredCapacityPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class ResourceDeclaredCapacityModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ resourceDeclaredCapacities: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'ResourceDeclaredCapacity', 'resourceDeclaredCapacities', 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, }, 'ResourceDeclaredCapacityFilter', 'ResourceDeclaredCapacityOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'ResourceDeclaredCapacity', fieldName: 'resourceDeclaredCapacities', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ resourceDeclaredCapacity: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'ResourceDeclaredCapacity', 'resourceDeclaredCapacities', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'ResourceDeclaredCapacityFilter', 'ResourceDeclaredCapacityOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'ResourceDeclaredCapacity', fieldName: 'resourceDeclaredCapacity', document, variables, transform: (data: { resourceDeclaredCapacities?: { nodes?: InferSelectResult[]; }; }) => ({ resourceDeclaredCapacity: data.resourceDeclaredCapacities?.nodes?.[0] ?? null, }), }); } }