/** * PlatformAgentPrompt 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 { PlatformAgentPrompt, PlatformAgentPromptWithRelations, PlatformAgentPromptSelect, PlatformAgentPromptFilter, PlatformAgentPromptOrderBy, CreatePlatformAgentPromptInput, UpdatePlatformAgentPromptInput, PlatformAgentPromptPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformAgentPromptModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformAgentPrompts: ConnectionResult>; }> { const { document, variables } = buildFindManyDocument( 'PlatformAgentPrompt', 'platformAgentPrompts', 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, }, 'PlatformAgentPromptFilter', 'PlatformAgentPromptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformAgentPrompt', fieldName: 'platformAgentPrompts', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformAgentPrompt: InferSelectResult | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformAgentPrompt', 'platformAgentPrompts', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformAgentPromptFilter', 'PlatformAgentPromptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformAgentPrompt', fieldName: 'platformAgentPrompt', document, variables, transform: (data: { platformAgentPrompts?: { nodes?: InferSelectResult[]; }; }) => ({ platformAgentPrompt: data.platformAgentPrompts?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformAgentPrompt: InferSelectResult | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformAgentPrompt', 'platformAgentPrompts', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformAgentPromptFilter', 'PlatformAgentPromptOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformAgentPrompt', fieldName: 'platformAgentPrompt', document, variables, transform: (data: { platformAgentPrompts?: { nodes?: InferSelectResult[]; }; }) => ({ platformAgentPrompt: data.platformAgentPrompts?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformAgentPrompt: { platformAgentPrompt: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformAgentPrompt', 'createPlatformAgentPrompt', 'platformAgentPrompt', args.select, args.data, 'CreatePlatformAgentPromptInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformAgentPrompt', fieldName: 'createPlatformAgentPrompt', document, variables, }); } update( args: UpdateArgs< S, { id: string; }, PlatformAgentPromptPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformAgentPrompt: { platformAgentPrompt: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformAgentPrompt', 'updatePlatformAgentPrompt', 'platformAgentPrompt', args.select, args.where.id, args.data, 'UpdatePlatformAgentPromptInput', 'id', 'platformAgentPromptPatch', connectionFieldsMap, undefined ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformAgentPrompt', fieldName: 'updatePlatformAgentPrompt', document, variables, }); } delete( args: DeleteArgs< { id: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformAgentPrompt: { platformAgentPrompt: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformAgentPrompt', 'deletePlatformAgentPrompt', 'platformAgentPrompt', { id: args.where.id, }, 'DeletePlatformAgentPromptInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformAgentPrompt', fieldName: 'deletePlatformAgentPrompt', document, variables, }); } }