/** * EmbeddingChunk 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 { EmbeddingChunk, EmbeddingChunkWithRelations, EmbeddingChunkSelect, EmbeddingChunkFilter, EmbeddingChunkOrderBy, CreateEmbeddingChunkInput, UpdateEmbeddingChunkInput, EmbeddingChunkPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class EmbeddingChunkModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ embeddingChunks: ConnectionResult>; }> { const { document, variables } = buildFindManyDocument( 'EmbeddingChunk', 'embeddingChunks', 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, }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'EmbeddingChunk', fieldName: 'embeddingChunks', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'EmbeddingChunk', 'embeddingChunks', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'EmbeddingChunk', fieldName: 'embeddingChunk', document, variables, transform: (data: { embeddingChunks?: { nodes?: InferSelectResult[]; }; }) => ({ embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ embeddingChunk: InferSelectResult | null; }> { const { document, variables } = buildFindManyDocument( 'EmbeddingChunk', 'embeddingChunks', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'EmbeddingChunkFilter', 'EmbeddingChunkOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'EmbeddingChunk', fieldName: 'embeddingChunk', document, variables, transform: (data: { embeddingChunks?: { nodes?: InferSelectResult[]; }; }) => ({ embeddingChunk: data.embeddingChunks?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'EmbeddingChunk', 'createEmbeddingChunk', 'embeddingChunk', args.select, args.data, 'CreateEmbeddingChunkInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'EmbeddingChunk', fieldName: 'createEmbeddingChunk', document, variables, }); } update( args: UpdateArgs< S, { id: string; }, EmbeddingChunkPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updateEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'EmbeddingChunk', 'updateEmbeddingChunk', 'embeddingChunk', args.select, args.where.id, args.data, 'UpdateEmbeddingChunkInput', 'id', 'embeddingChunkPatch', connectionFieldsMap, undefined ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'EmbeddingChunk', fieldName: 'updateEmbeddingChunk', document, variables, }); } delete( args: DeleteArgs< { id: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deleteEmbeddingChunk: { embeddingChunk: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'EmbeddingChunk', 'deleteEmbeddingChunk', 'embeddingChunk', { id: args.where.id, }, 'DeleteEmbeddingChunkInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'EmbeddingChunk', fieldName: 'deleteEmbeddingChunk', document, variables, }); } }