/// import { MappedDataSource } from "./MappedDataSource"; import * as t from "io-ts"; import { GraphQLObjectType, GraphQLFieldConfigMap, GraphQLInputObjectType, GraphQLInputFieldConfigMap, GraphQLOutputType } from "graphql"; import { MappedField } from "./MappedField"; /** * Utilities to create GraphQL type descriptors from various GRelDAL specific inputs */ /** * GraphQL type representing information about current page in a paginated query */ export declare const pageInfoType: (() => GraphQLObjectType) & import("lodash").MemoizedFunction; /** * Derive default GraphQL output type for specified data source */ export declare const deriveDefaultOutputType: >(mappedDataSource: TSrc) => GraphQLObjectType; /** * Derive output type for a paginated query * * @param pageContainerName Name of page container type * @param pageName Name of page type * @param wrappedType GraphQL output type of the entity being queried */ export declare const derivePaginatedOutputType: (pageContainerName: string, pageName: string, wrappedType: GraphQLOutputType) => GraphQLObjectType; /** * Derive the default GraphQL input type for specified data source excluding associations */ export declare const deriveDefaultShallowInputType: >(mappedDataSource: TSrc) => GraphQLInputObjectType; /** * Derive the GraphQL Input type for union of fields from multiple specified data sources */ export declare const deriveDefaultShallowUnionInputType: >(mappedDataSources: TSrc[]) => GraphQLInputObjectType; /** * Derive the GraphQL output type for a data source including only the (primary and computed) fields and not the associations */ export declare const deriveDefaultShallowOutputType: >(mappedDataSource: TSrc) => GraphQLObjectType; export declare const deriveDefaultIdOutputType: >(source: TSrc) => GraphQLObjectType; /** * Build GraphQLInputFieldConfig dictionary from field definitions of a data source * * This is primarily useful for deriving GraphQL input type for a data source. */ export declare const mapInputFields: (dataSource: MappedDataSource, result?: GraphQLInputFieldConfigMap) => GraphQLInputFieldConfigMap; /** * Build GraphQLFieldConfig dictionary from field definitions of a data source. * * This is primarily useful for deriving GraphQL output type for a data source. */ export declare const mapOutputFields: (dataSource: MappedDataSource, result?: GraphQLFieldConfigMap, predicate?: (field: MappedField, any>) => boolean) => GraphQLFieldConfigMap; /** * Build GraphQLFieldConfig dictionary from association definitions of a data source. * * This is primarily useful for deriving GraphQL output type for a data source. */ export declare const mapOutputAssociationFields: (dataSource: MappedDataSource, result?: GraphQLFieldConfigMap) => GraphQLFieldConfigMap; /** * Check if one io-ts type is a refinement of another */ export declare const isOrRefinedFrom: (type: t.Type) => (targetType: t.Type) => boolean; /** * For singular operations, unwraps first result if result set is a collection * For non-singular operations, wraps result set into a collection (if not already) * * This utility liberates resolver authors from worrying about whether or not an operation is singular * when returning the results. */ export declare function normalizeResultsForSingularity(result: any, singular: boolean, paginated: boolean): any;