UNPKG

1.43 kBTypeScriptView Raw
1/**
2 * Functions to translate JSON schema to GraphQL (input) object types.
3 */
4import { PreprocessingData } from './types/preprocessing_data';
5import { Operation, DataDefinition } from './types/operation';
6import { ParameterObject } from './types/oas3';
7import { Args, GraphQLType } from './types/graphql';
8declare type GetArgsParams<TSource, TContext, TArgs> = {
9 requestPayloadDef?: DataDefinition;
10 parameters: ParameterObject[];
11 operation?: Operation;
12 data: PreprocessingData<TSource, TContext, TArgs>;
13 includeHttpDetails: boolean;
14};
15declare type CreateOrReuseComplexTypeParams<TSource, TContext, TArgs> = {
16 def: DataDefinition;
17 operation?: Operation;
18 iteration?: number;
19 isInputObjectType?: boolean;
20 data: PreprocessingData<TSource, TContext, TArgs>;
21 includeHttpDetails: boolean;
22};
23/**
24 * Creates and returns a GraphQL type for the given JSON schema.
25 */
26export declare function getGraphQLType<TSource, TContext, TArgs>({ def, operation, data, iteration, isInputObjectType, includeHttpDetails, }: CreateOrReuseComplexTypeParams<TSource, TContext, TArgs>): GraphQLType;
27/**
28 * Creates the arguments for resolving a field
29 *
30 * Arguments that are provided via options will be ignored
31 */
32export declare function getArgs<TSource, TContext, TArgs>({ requestPayloadDef, parameters, operation, data, includeHttpDetails, }: GetArgsParams<TSource, TContext, TArgs>): Args;
33export {};