/** * MyPendingOrgInvitesRecord 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 { MyPendingOrgInvitesRecord, MyPendingOrgInvitesRecordWithRelations, MyPendingOrgInvitesRecordSelect, MyPendingOrgInvitesRecordFilter, MyPendingOrgInvitesRecordsOrderBy, UpdateMyPendingOrgInvitesRecordInput, MyPendingOrgInvitesRecordPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class MyPendingOrgInvitesRecordModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ myPendingOrgInvites: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'MyPendingOrgInvitesRecord', 'myPendingOrgInvites', 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, }, 'MyPendingOrgInvitesRecordFilter', 'MyPendingOrgInvitesRecordsOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'MyPendingOrgInvitesRecord', fieldName: 'myPendingOrgInvites', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ myPendingOrgInvitesRecord: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'MyPendingOrgInvitesRecord', 'myPendingOrgInvites', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'MyPendingOrgInvitesRecordFilter', 'MyPendingOrgInvitesRecordsOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'MyPendingOrgInvitesRecord', fieldName: 'myPendingOrgInvitesRecord', document, variables, transform: (data: { myPendingOrgInvites?: { nodes?: InferSelectResult[]; }; }) => ({ myPendingOrgInvitesRecord: data.myPendingOrgInvites?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ myPendingOrgInvitesRecord: InferSelectResult | null; }> { const { document, variables } = buildFindManyDocument( 'MyPendingOrgInvitesRecord', 'myPendingOrgInvites', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'MyPendingOrgInvitesRecordFilter', 'MyPendingOrgInvitesRecordsOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'MyPendingOrgInvitesRecord', fieldName: 'myPendingOrgInvitesRecord', document, variables, transform: (data: { myPendingOrgInvites?: { nodes?: InferSelectResult[]; }; }) => ({ myPendingOrgInvitesRecord: data.myPendingOrgInvites?.nodes?.[0] ?? null, }), }); } }