/** * PlatformFunctionDefinition 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 { PlatformFunctionDefinition, PlatformFunctionDefinitionWithRelations, PlatformFunctionDefinitionSelect, PlatformFunctionDefinitionFilter, PlatformFunctionDefinitionOrderBy, CreatePlatformFunctionDefinitionInput, UpdatePlatformFunctionDefinitionInput, PlatformFunctionDefinitionPatch, } from '../input-types'; import { connectionFieldsMap } from '../input-types'; export class PlatformFunctionDefinitionModel { constructor(private client: OrmClient) {} findMany( args: FindManyArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDefinitions: ConnectionResult< InferSelectResult >; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDefinition', 'platformFunctionDefinitions', 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, }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDefinition', fieldName: 'platformFunctionDefinitions', document, variables, }); } findFirst( args: FindFirstArgs & { select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDefinition: InferSelectResult< PlatformFunctionDefinitionWithRelations, S > | null; }> { const { document, variables } = buildFindFirstDocument( 'PlatformFunctionDefinition', 'platformFunctionDefinitions', args.select, { where: args?.where, orderBy: args?.orderBy as string[] | undefined, }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDefinition', fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { platformFunctionDefinitions?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, }), }); } findOne( args: { id: string; select: S; } & StrictSelect ): QueryBuilder<{ platformFunctionDefinition: InferSelectResult< PlatformFunctionDefinitionWithRelations, S > | null; }> { const { document, variables } = buildFindManyDocument( 'PlatformFunctionDefinition', 'platformFunctionDefinitions', args.select, { where: { id: { equalTo: args.id, }, }, first: 1, }, 'PlatformFunctionDefinitionFilter', 'PlatformFunctionDefinitionOrderBy', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'query', operationName: 'PlatformFunctionDefinition', fieldName: 'platformFunctionDefinition', document, variables, transform: (data: { platformFunctionDefinitions?: { nodes?: InferSelectResult[]; }; }) => ({ platformFunctionDefinition: data.platformFunctionDefinitions?.nodes?.[0] ?? null, }), }); } create( args: CreateArgs & { select: S; } & StrictSelect ): QueryBuilder<{ createPlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { const { document, variables } = buildCreateDocument( 'PlatformFunctionDefinition', 'createPlatformFunctionDefinition', 'platformFunctionDefinition', args.select, args.data, 'CreatePlatformFunctionDefinitionInput', connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDefinition', fieldName: 'createPlatformFunctionDefinition', document, variables, }); } update( args: UpdateArgs< S, { id: string; }, PlatformFunctionDefinitionPatch > & { select: S; } & StrictSelect ): QueryBuilder<{ updatePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { const { document, variables } = buildUpdateByPkDocument( 'PlatformFunctionDefinition', 'updatePlatformFunctionDefinition', 'platformFunctionDefinition', args.select, args.where.id, args.data, 'UpdatePlatformFunctionDefinitionInput', 'id', 'platformFunctionDefinitionPatch', connectionFieldsMap, undefined ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDefinition', fieldName: 'updatePlatformFunctionDefinition', document, variables, }); } delete( args: DeleteArgs< { id: string; }, S > & { select: S; } & StrictSelect ): QueryBuilder<{ deletePlatformFunctionDefinition: { platformFunctionDefinition: InferSelectResult; }; }> { const { document, variables } = buildDeleteByPkDocument( 'PlatformFunctionDefinition', 'deletePlatformFunctionDefinition', 'platformFunctionDefinition', { id: args.where.id, }, 'DeletePlatformFunctionDefinitionInput', args.select, connectionFieldsMap ); return new QueryBuilder({ client: this.client, operation: 'mutation', operationName: 'PlatformFunctionDefinition', fieldName: 'deletePlatformFunctionDefinition', document, variables, }); } }