/** * Functions to create resolve functions. */ import { ParameterObject } from './types/oas3'; import { Operation } from './types/operation'; import { ResolveFunction, SubscriptionContext } from './types/graphql'; import { PreprocessingData } from './types/preprocessing_data'; import { GraphQLFieldResolver } from 'graphql'; import { ConnectOptions, RequestOptions } from './types/options'; import { MeshPubSub } from '@graphql-mesh/types'; declare type GetResolverParams = { operation: Operation; argsFromLink?: Record; payloadName?: string; responseName?: string; data: PreprocessingData; baseUrl?: string; requestOptions?: RequestOptions; fetch?: (input: RequestInfo, init?: RequestInit) => Promise; qs?: Record; }; declare type GetSubscribeParams = { operation: Operation; argsFromLink?: { [key: string]: string; }; payloadName?: string; data: PreprocessingData; baseUrl?: string; connectOptions?: ConnectOptions; pubsub: MeshPubSub; }; export declare function getSubscribe({ operation, payloadName, data, baseUrl, connectOptions, pubsub, }: GetSubscribeParams): GraphQLFieldResolver; export declare function getPublishResolver({ operation, responseName, data, }: GetResolverParams): GraphQLFieldResolver; export declare type ResolverMiddleware = (getResolverParams: () => GetResolverParams, factory: ResolverFactory) => ResolveFunction; declare type ResolverFactory = typeof getResolver; /** * Creates and returns a resolver function that performs API requests for the * given GraphQL query */ export declare function getResolver(getResolverParams: () => GetResolverParams): ResolveFunction; /** * Extracts data from the GraphQL arguments of a particular field * * Replaces the path parameter in the given path with values in the given args. * Furthermore adds the query parameters for a request. */ export declare function extractRequestDataFromArgs(path: string, parameters: ParameterObject[], args: TArgs, // NOTE: argument keys are sanitized! data: PreprocessingData): { path: string; qs: { [key: string]: string; }; headers: { [key: string]: string; }; }; export {};