UNPKG

1.06 kBTypeScriptView Raw
1import { GraphQLFieldConfigArgumentMap, GraphQLInputType } from 'graphql';
2import { ResolverData } from '@graphql-mesh/types';
3export declare type ResolverDataBasedFactory<T> = (data: ResolverData) => T;
4export declare type ArgTypeMap = {
5 [argName: string]: GraphQLInputType | ArgType;
6};
7export declare enum ArgType {
8 ID = "ID",
9 String = "String",
10 Boolean = "Boolean",
11 Float = "Float",
12 Int = "Int"
13}
14export declare function getInputTypeFromTypeName(typeName: GraphQLInputType | ArgType): GraphQLInputType;
15export declare function parseInterpolationStrings(interpolationStrings: string[], argTypeMap?: ArgTypeMap): {
16 args: GraphQLFieldConfigArgumentMap;
17 contextVariables: string[];
18};
19export declare function getInterpolatedStringFactory(nonInterpolatedString: string): ResolverDataBasedFactory<string>;
20export declare function getInterpolatedHeadersFactory(nonInterpolatedHeaders?: Record<string, string>): ResolverDataBasedFactory<Headers>;
21export declare function getHeadersObject(headers: Headers): Record<string, string>;