import { Class } from '@nestjs-query/core'; import { Complexity } from '@nestjs/graphql'; import { DTONamesOpts } from '../../common'; import { ResolverMethodOpts } from '../../decorators'; import { QueryArgsTypeOpts, ConnectionOptions } from '../../types'; import { AuthorizerOptions } from '../../auth'; export declare type ReferencesKeys = { [F in keyof Reference]?: keyof DTO; }; export interface ResolverRelationReference extends DTONamesOpts, ResolverMethodOpts { /** * The class type of the relation. */ DTO: Class; /** * Keys */ keys: ReferencesKeys; /** * Set to true if the relation is nullable */ nullable?: boolean; complexity?: Complexity; } export declare type ResolverRelation = { /** * The class type of the relation. */ DTO: Class; /** * The name of the relation to use when fetching from the QueryService */ relationName?: string; /** * Set to true if the relation is nullable */ nullable?: boolean; /** * Disable read relation graphql endpoints */ disableRead?: boolean; /** * Disable update relation graphql endpoints */ disableUpdate?: boolean; /** * Disable remove relation graphql endpoints */ disableRemove?: boolean; /** * Enable aggregation queries. */ enableAggregate?: boolean; /** * Set to true if you should be able to filter on this relation. * * This will only work with relations defined through an ORM (typeorm or sequelize). */ allowFiltering?: boolean; complexity?: Complexity; auth?: AuthorizerOptions; } & DTONamesOpts & ResolverMethodOpts & QueryArgsTypeOpts & Pick; export declare type RelationTypeMap = Record; export declare type RelationsOpts = { /** * All relations that are a single record */ one?: RelationTypeMap>; /** * All relations that have multiple records */ many?: RelationTypeMap>; }; export declare type ReferencesOpts = RelationTypeMap>;