import * as t from "io-ts"; import * as Knex from "knex"; import { Dict } from "./utils/util-types"; import { TypeSpec } from "./utils/types"; export declare const ArgMappingRT: t.IntersectionC<[t.PartialC<{ /** * Description exposed to clients through mapped GraphQL API * * @memberof ArgMapping */ description: t.StringC; interceptQuery: t.FunctionC; interceptEntity: t.FunctionC; defaultValue: t.AnyC; }>, t.TypeC<{ type: import("./utils/util-types").InstanceType>; }>]>; export declare const ArgMappingDictRT: t.RecordC, t.TypeC<{ type: import("./utils/util-types").InstanceType>; }>]>>; /** * Configuration for mapping of an input argument * * @api-category ConfigType */ export interface ArgMapping extends t.TypeOf { /** * Type specification for this argument * * Normally this would be a composition of one of the runtime types exposed through types library. * These types are simply re-exported from [io-ts](https://github.com/gcanti/io-ts) and detailed documentation can be found there. * * Example: * * ``` * // Primitives * t.string * t.number * * // Composite types * t.type({ * x: t.number, * y: t.number * }) * * t.array(t.string) * ``` */ type: TypeSpec; /** * Default value of this argument. * * Exposed to clients through mapped GraphQL API */ defaultValue?: TMapped; /** * Can be used to intercept the database query being constructed during query * * This opens up the ability to map an argument value to an arbitrary database query operation. */ interceptQuery?: (queryBuilder: Knex.QueryBuilder, value: TMapped, args: Dict) => Knex.QueryBuilder; /** * Can be used to intercept the derived entity to be used for the operation this argument is part of. * * Typically useful for insert, update operations. */ interceptEntity?: (entity: Partial) => Partial; }