/** * PlatformFunctionInvocation 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 { PlatformFunctionInvocation, PlatformFunctionInvocationWithRelations, PlatformFunctionInvocationSelect, PlatformFunctionInvocationFilter, PlatformFunctionInvocationOrderBy, CreatePlatformFunctionInvocationInput, UpdatePlatformFunctionInvocationInput, PlatformFunctionInvocationPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionInvocationModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocations: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionInvocation', 'platformFunctionInvocations', 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, }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocation', fieldName: 'platformFunctionInvocations', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocation: InferSelectResult< PlatformFunctionInvocationWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionInvocation', 'platformFunctionInvocations', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocation', fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { platformFunctionInvocations?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionInvocation: InferSelectResult< PlatformFunctionInvocationWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionInvocation', 'platformFunctionInvocations', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionInvocationFilter', 'PlatformFunctionInvocationOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionInvocation', fieldName: 'platformFunctionInvocation', document, variables, transform: (data: { platformFunctionInvocations?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionInvocation: data.platformFunctionInvocations?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionInvocation', 'createPlatformFunctionInvocation', 'platformFunctionInvocation', args.select, args.data, 'CreatePlatformFunctionInvocationInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocation', fieldName: 'createPlatformFunctionInvocation', document, variables, }); } update( args: UpdateArgs< S, { id: string; createdAt: string; }, PlatformFunctionInvocationPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionInvocation', 'updatePlatformFunctionInvocation', 'platformFunctionInvocation', args.select, args.where.id, args.data, 'UpdatePlatformFunctionInvocationInput', 'id', 'platformFunctionInvocationPatch', connectionFieldsMap, { createdAt: args.where.createdAt, } ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocation', fieldName: 'updatePlatformFunctionInvocation', document, variables, }); } delete( args: DeleteArgs< { id: string; createdAt: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionInvocation: { platformFunctionInvocation: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionInvocation', 'deletePlatformFunctionInvocation', 'platformFunctionInvocation', { id: args.where.id, createdAt: args.where.createdAt, }, 'DeletePlatformFunctionInvocationInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionInvocation', fieldName: 'deletePlatformFunctionInvocation', document, variables, }); } }