UNPKG

975 BTypeScriptView Raw
1/**
2 * Functions to create viewers that allow users to pass credentials to resolve
3 * functions used by OpenAPI-to-GraphQL.
4 */
5import { GraphQLObjectType, GraphQLFieldResolver } from 'graphql';
6import { Args, GraphQLOperationType } from './types/graphql';
7import { PreprocessingData } from './types/preprocessing_data';
8declare type Viewer<TSource, TContext, TArgs> = {
9 type: GraphQLObjectType;
10 resolve: GraphQLFieldResolver<TSource, TContext, TArgs>;
11 args: Args;
12 description: string;
13};
14/**
15 * Load the field object in the appropriate root object
16 *
17 * i.e. inside either rootQueryFields/rootMutationFields or inside
18 * rootQueryFields/rootMutationFields for further processing
19 */
20export declare function createAndLoadViewer<TSource, TContext, TArgs>(queryFields: any, operationType: GraphQLOperationType, data: PreprocessingData<TSource, TContext, TArgs>, includeHttpDetails: boolean): {
21 [key: string]: Viewer<TSource, TContext, TArgs>;
22};
23export {};